Skip to content

Commit 2cfedb1

Browse files
author
Sven Sandberg
committed
BUG#36381815 step 3.1: Update readme files after previous step
Part of: Bug#36381815: Factor out generic functionality from the mysql_binlog_event library Update libs/mysql/readme.md to list the new library and describe the library in libs/mysql/allocators/readme.md. (We don't squash this into step 2, in order to keep step 2 reproducible with scripts.) Change-Id: I71ecefd931401517718a5a3c16f384a4826255c5
1 parent 986786b commit 2cfedb1

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

libs/mysql/allocators/readme.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,30 @@ MySQL Allocators Library
3131
-->
3232

3333
Code documentation: @ref GroupLibsMysqlAllocators.
34+
35+
## Summary
36+
37+
Allows libraries to allocate memory such that:
38+
- The server can use the library in such a way that the memory is
39+
performance_schema-instrumented.
40+
- Other code can use the library without performance_schema instrumentation.
41+
- The library is never dependent on performance_schema.
42+
43+
## Usage
44+
45+
This library provides the `Memory_resource` class, which is used in different
46+
ways depending on who you are:
47+
48+
- *Library author*: If your library needs to allocate memory, add a
49+
`Memory_resource` parameter to either the function that allocates memory or
50+
the constructor for the class that manages the memory. The parameter must be
51+
passed by value, not reference or pointer. Allocate memory through this
52+
object. Make the parameter default to `Memory_resource()`.
53+
54+
- *Library user within the MySQL server*: When using the function or class that
55+
takes a `Memory_resource` object, call `psi_memory_resource(Psi_memory_key)`
56+
to get the `Memory_resource` object to pass to the function or constructor.
57+
58+
- *Library user outside the MySQL server*: When using the function or class
59+
constructor that takes an optional `Memory_resource` parameter, allow that
60+
parameter to take its default value.

libs/mysql/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ which is subject to change. Use on your own responsibility.
3737
For now, we build only the static libraries.
3838

3939
Libraries defined on this level:
40-
- \subpage PageLibsMysqlGtid
40+
- \subpage PageLibsMysqlAllocators
4141
- \subpage PageLibsMysqlBinlog
42+
- \subpage PageLibsMysqlGtid
4243
- \subpage PageLibsMysqlSerialization
4344
- \subpage PageLibsMysqlUtils
4445

0 commit comments

Comments
 (0)