34 #ifndef UNIV_HOTBACKUP
56 #define MEM_HEAP_DYNAMIC 0
57 #define MEM_HEAP_BUFFER 1
58 #define MEM_HEAP_BTR_SEARCH 2
71 #define MEM_BLOCK_START_SIZE 64
72 #define MEM_BLOCK_STANDARD_SIZE \
73 (UNIV_PAGE_SIZE >= 16384 ? 8000 : MEM_MAX_ALLOC_IN_BUF)
77 #define MEM_MAX_ALLOC_IN_BUF (UNIV_PAGE_SIZE - 200)
97 #define mem_heap_create(N) mem_heap_create_func(\
98 (N), MEM_HEAP_DYNAMIC, __FILE__, __LINE__)
103 #define mem_heap_create_in_buffer(N) mem_heap_create_func(\
104 (N), MEM_HEAP_BUFFER, __FILE__, __LINE__)
109 #define mem_heap_create_in_btr_search(N) mem_heap_create_func(\
110 (N), MEM_HEAP_BTR_SEARCH | MEM_HEAP_BUFFER,\
117 #define mem_heap_free(heap) mem_heap_free_func(\
118 (heap), __FILE__, __LINE__)
134 const char* file_name,
145 const char* file_name,
225 #define mem_zalloc(N) memset(mem_alloc(N), 0, (N))
227 #define mem_alloc(N) mem_alloc_func((N), NULL, __FILE__, __LINE__)
228 #define mem_alloc2(N,S) mem_alloc_func((N), (S), __FILE__, __LINE__)
242 const char* file_name,
249 #define mem_free(PTR) mem_free_func((PTR), __FILE__, __LINE__)
259 const char* file_name,
335 ...) __attribute__ ((format (printf, 2, 3)));
337 #ifdef MEM_PERIODIC_CHECK
343 mem_validate_all_blocks(
void);
372 #ifndef UNIV_HOTBACKUP
384 #ifdef MEM_PERIODIC_CHECK
391 #define MEM_BLOCK_MAGIC_N 764741555
392 #define MEM_FREED_BLOCK_MAGIC_N 547711122
395 #define MEM_BLOCK_HEADER_SIZE ut_calc_align(sizeof(mem_block_info_t),\
400 #include "mem0mem.ic"
UNIV_INLINE void * mem_heap_get_top(mem_heap_t *heap, ulint n)
UNIV_INLINE void mem_free_func(void *ptr, const char *file_name, ulint line)
UNIV_INLINE ulint mem_heap_get_size(mem_heap_t *heap)
UNIV_INTERN void mem_close(void)
UNIV_INTERN void * mem_heap_dup(mem_heap_t *heap, const void *data, ulint len)
UNIV_INLINE void mem_heap_free_heap_top(mem_heap_t *heap, byte *old_top)
UNIV_INTERN char * mem_heap_strdup(mem_heap_t *heap, const char *str)
UNIV_INTERN char * mem_heap_strcat(mem_heap_t *heap, const char *s1, const char *s2)
UNIV_INLINE char * mem_heap_strdupl(mem_heap_t *heap, const char *str, ulint len)
UNIV_INLINE void mem_heap_free_top(mem_heap_t *heap, ulint n)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
UNIV_INLINE void * mem_heap_zalloc(mem_heap_t *heap, ulint n)
UNIV_INTERN char * mem_heap_printf(mem_heap_t *heap, const char *format,...) __attribute__((format(printf
UNIV_INLINE mem_heap_t * mem_heap_create_func(ulint n, ulint type, const char *file_name, ulint line)
UNIV_INLINE void mem_heap_empty(mem_heap_t *heap)
UNIV_INTERN void mem_init(ulint size)
UNIV_INLINE char * mem_strdupl(const char *str, ulint len)
UNIV_INLINE char * mem_strdup(const char *str)
UNIV_INLINE byte * mem_heap_get_heap_top(mem_heap_t *heap)
UNIV_INLINE void * mem_alloc_func(ulint n, ulint *size, const char *file_name, ulint line)
UNIV_INLINE void mem_heap_free_func(mem_heap_t *heap, const char *file_name, ulint line)