MySQL 8.0.40
Source Code Documentation
|
#include "mysql/components/library_mysys/my_memory.h"
#include <assert.h>
#include <stdlib.h>
#include "mysql/components/services/psi_memory.h"
Classes | |
struct | my_memory_header |
Macros | |
#define | MEM_MALLOCLIKE_BLOCK(p1, p2, p3, p4) |
#define | MEM_FREELIKE_BLOCK(p1, p2) |
#define | HEADER_SIZE 32 |
#define | MAGIC 1234 |
#define | USER_TO_HEADER(P) ((my_memory_header *)(((char *)P) - HEADER_SIZE)) |
#define | HEADER_TO_USER(P) (((char *)P) + HEADER_SIZE) |
Typedefs | |
typedef struct my_memory_header | my_memory_header |
Functions | |
void * | my_malloc (PSI_memory_key key, size_t size, int flags) |
Allocates size bytes of memory. More... | |
void | my_free (void *ptr) |
Frees the memory pointed by the ptr. More... | |
#define HEADER_SIZE 32 |
#define HEADER_TO_USER | ( | P | ) | (((char *)P) + HEADER_SIZE) |
#define MAGIC 1234 |
#define MEM_FREELIKE_BLOCK | ( | p1, | |
p2 | |||
) |
#define MEM_MALLOCLIKE_BLOCK | ( | p1, | |
p2, | |||
p3, | |||
p4 | |||
) |
#define USER_TO_HEADER | ( | P | ) | ((my_memory_header *)(((char *)P) - HEADER_SIZE)) |
typedef struct my_memory_header my_memory_header |
void my_free | ( | void * | ptr | ) |
Frees the memory pointed by the ptr.
ptr | memory address to be freed |
void * my_malloc | ( | PSI_memory_key | key, |
size_t | size, | ||
int | flags | ||
) |
Allocates size bytes of memory.
key | P_S key used for memory instrumentation |
size | size bytes to allocate the memory |
flags | used at the time of allocation. Could be MY_ZEROFILL |