InnoDB Plugin  1.0
Macros | Functions
mem0dbg.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MEM_FIELD_HEADER_SIZE   0
#define MEM_SPACE_NEEDED(N)   ut_calc_align((N), UNIV_MEM_ALIGNMENT)

Functions

UNIV_INTERN void mem_heap_validate_or_print (mem_heap_t *heap, byte *top, ibool print, ibool *error, ulint *us_size, ulint *ph_size, ulint *n_blocks)
UNIV_INTERN ibool mem_heap_validate (mem_heap_t *heap)
UNIV_INTERN ibool mem_heap_check (mem_heap_t *heap)
UNIV_INTERN void mem_analyze_corruption (void *ptr)
UNIV_INTERN void mem_print_info (void)
UNIV_INTERN void mem_print_new_info (void)

Detailed Description

The memory management: the debug code. This is not a compilation module, but is included in mem0mem.* !

Created 6/9/1994 Heikki Tuuri

Function Documentation

UNIV_INTERN void mem_analyze_corruption ( void *  ptr)

Tries to find neigboring memory allocation blocks and dumps to stderr the neighborhood of a given pointer. in: pointer to place of possible corruption

UNIV_INTERN ibool mem_heap_check ( mem_heap_t heap)

Checks that an object is a memory heap (or a block of it)

Returns
TRUE if ok in: memory heap
UNIV_INTERN ibool mem_heap_validate ( mem_heap_t heap)

Validates the contents of a memory heap.

Returns
TRUE if ok in: memory heap
UNIV_INTERN void mem_heap_validate_or_print ( mem_heap_t heap,
byte *  top,
ibool  print,
ibool error,
ulint *  us_size,
ulint *  ph_size,
ulint *  n_blocks 
)

Checks a memory heap for consistency and prints the contents if requested. Outputs the sum of sizes of buffers given to the user (only in the debug version), the physical size of the heap and the number of blocks in the heap. In case of error returns 0 as sizes and number of blocks. out: number of blocks in the heap, if a NULL pointer is passed as this argument, it is ignored

Parameters
heapin: memory heap
topin: calculate and validate only until this top pointer in the heap is reached, if this pointer is NULL, ignored
printin: if TRUE, prints the contents of the heap; works only in the debug version
errorout: TRUE if error
us_sizeout: allocated memory (for the user) in the heap, if a NULL pointer is passed as this argument, it is ignored; in the non-debug version this is always -1
ph_sizeout: physical size of the heap, if a NULL pointer is passed as this argument, it is ignored
UNIV_INTERN void mem_print_info ( void  )

Prints information of dynamic memory usage and currently allocated memory heaps or buffers. Can only be used in the debug version.

UNIV_INTERN void mem_print_new_info ( void  )

Prints information of dynamic memory usage and currently allocated memory heaps or buffers since the last ..._print_info or..._print_new_info.