MySQL 8.0.40
Source Code Documentation
|
Contains wrapper functions for memory allocation and deallocation. More...
#include "binlog_config.h"
#include "my_config.h"
#include "my_sys.h"
#include "mysql/service_mysql_alloc.h"
#include "my_dbug.h"
Go to the source code of this file.
Macros | |
#define | HAVE_MYSYS 1 |
#define | BAPI_ASSERT(x) assert(x) |
#define | BAPI_PRINT(name, params) DBUG_PRINT(name, params) |
#define | BAPI_ENTER(x) DBUG_ENTER(x) |
#define | BAPI_RETURN(x) DBUG_RETURN(x) |
#define | BAPI_TRACE DBUG_TRACE |
#define | BAPI_VOID_RETURN DBUG_VOID_RETURN |
#define | BAPI_LOG(x, y) DBUG_LOG(x, y) |
#define | BAPI_VAR(v) DBUG_VAR(v) |
Functions | |
const char * | bapi_strndup (const char *destination, size_t n) |
This is a wrapper function, and returns a pointer to a new string which is a duplicate of the input string. More... | |
void * | bapi_memdup (const void *source, size_t len) |
This is a wrapper function, and returns a pointer to a new memory with the contents copied from the input memory pointer, up to a given length. More... | |
void * | bapi_malloc (size_t size, int flags) |
This is a wrapper function in order to allocate memory from the heap in the binlogevent library. More... | |
void | bapi_free (void *ptr) |
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent library. More... | |
Variables | |
PSI_memory_key | key_memory_log_event |
Contains wrapper functions for memory allocation and deallocation.
This includes generic functions to be called from the binlogevent library, which call the appropriate corresponding function, depending on whether the library is compiled independently, or with the MySQL server.
#define BAPI_ASSERT | ( | x | ) | assert(x) |
#define BAPI_ENTER | ( | x | ) | DBUG_ENTER(x) |
#define BAPI_LOG | ( | x, | |
y | |||
) | DBUG_LOG(x, y) |
#define BAPI_PRINT | ( | name, | |
params | |||
) | DBUG_PRINT(name, params) |
#define BAPI_RETURN | ( | x | ) | DBUG_RETURN(x) |
#define BAPI_TRACE DBUG_TRACE |
#define BAPI_VAR | ( | v | ) | DBUG_VAR(v) |
#define BAPI_VOID_RETURN DBUG_VOID_RETURN |
#define HAVE_MYSYS 1 |
|
inline |
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent library.
If compiled with the MySQL server, and memory is allocated using memory allocating methods from the mysys library, my_free is called. Otherwise, the standard free() is called from the function.
ptr | Pointer to the memory which is to be freed. |
|
inline |
This is a wrapper function in order to allocate memory from the heap in the binlogevent library.
If compiled with the MySQL server, and memory is allocated using memory allocating methods from the mysys library, my_malloc is called. Otherwise, the standard malloc() is called from the function.
size | Size of the memory to be allocated. |
flags | flags to pass to MySQL server my_malloc functions |
|
inline |
This is a wrapper function, and returns a pointer to a new memory with the contents copied from the input memory pointer, up to a given length.
source | Pointer to the buffer from which data is to be copied |
len | Length up to which the source should be copied |
|
inline |
This is a wrapper function, and returns a pointer to a new string which is a duplicate of the input string.
The terminating Null character is added.
If compiled with MySQL server,the strndup function from the mysys library is called, which allow instrumenting memory allocated. Else, the standard string function is called.
destination | The string to be duplicated |
n | The number of bytes to be copied |
|
extern |