Description

Macro: DEBUG_MEMORY

#define DEBUG_MEMORY

DEBUG_MEMORY replaces the allocator with a collect and debug shell to the libc allocator. DEBUG_MEMORY should only be activated when debugging libxml i.e. if libxml has been configured with --with-debug-mem too. #define DEBUG_MEMORY_FREED #define DEBUG_MEMORY_LOCATION

Function: xmlCleanupMemory

void xmlCleanupMemory (void)

Free up all the memory allocated by the library for its own use. This should not be called by user level code.

Function: xmlGcMemSetup

Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators Should this be blocked if there was already some allocations done ?

freeFunc:

the free() function to use

mallocFunc:

the malloc() function to use

mallocAtomicFunc:

the malloc() function to use for atomic allocations

reallocFunc:

the realloc() function to use

strdupFunc:

the strdup() function to use

Returns:

0 on success

Function: xmlInitMemory

int xmlInitMemory (void)

Initialize the memory layer.

Returns:

0 on success

Function: xmlMallocAtomicLoc

void * xmlMallocAtomicLoc (size_t size, const char * file, int line)

a malloc() equivalent, with logging of the allocation info.

size:

an unsigned int specifying the size in byte to allocate.

file:

the file name or NULL

line:

the line number

Returns:

a pointer to the allocated area or NULL in case of lack of memory.

Function type: xmlMallocFunc

Function type: xmlMallocFunc
void * xmlMallocFunc (size_t size)

Signature for a malloc() implementation.

size:

the size requested in bytes

Returns:

a pointer to the newly allocated block or NULL in case of error.

Function: xmlMallocLoc

void * xmlMallocLoc (size_t size, const char * file, int line)

a malloc() equivalent, with logging of the allocation info.

size:

an int specifying the size in byte to allocate.

file:

the file name or NULL

line:

the line number

Returns:

a pointer to the allocated area or NULL in case of lack of memory.

Function: xmlMemBlocks

int xmlMemBlocks (void)

Provides the number of memory areas currently allocated

Returns:

an int representing the number of blocks

Function: xmlMemDisplay

void xmlMemDisplay (FILE * fp)

show in-extenso the memory blocks allocated

fp:

a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist

Function: xmlMemDisplayLast

void xmlMemDisplayLast (FILE * fp, long nbBytes)

the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.

fp:

a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist