xmlmemory

xmlmemory —

Synopsis




#define     DEBUG_MEMORY
void        (*xmlFreeFunc)                  (void *mem);
void*       (*xmlMallocFunc)                (size_t size);
void*       (*xmlReallocFunc)               (void *mem,
                                             size_t size);
char*       (*xmlStrdupFunc)                (const char *str);
#define     xmlMalloc                       (size)
#define     xmlMallocAtomic                 (size)
#define     xmlRealloc                      (ptr, size)
#define     xmlMemStrdup                    (str)

Description

Details

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.


xmlFreeFunc ()

void        (*xmlFreeFunc)                  (void *mem);

Signature for a free() implementation.

mem: an already allocated block of memory

xmlMallocFunc ()

void*       (*xmlMallocFunc)                (size_t size);

Signature for a malloc() implementation.

size: the size requested in bytes

xmlReallocFunc ()

void*       (*xmlReallocFunc)               (void *mem,
                                             size_t size);

Signature for a realloc() implementation.

mem: an already allocated block of memory
size: the new size requested in bytes

xmlStrdupFunc ()

char*       (*xmlStrdupFunc)                (const char *str);

Signature for an strdup() implementation.

str: a zero terminated string
Returns :the copy of the string or NULL in case of error.

xmlMalloc()

#define     xmlMalloc(size)

Wrapper for the malloc() function used in the XML library.

size: number of bytes to allocate

xmlMallocAtomic()

#define     xmlMallocAtomic(size)

Wrapper for the malloc() function used in the XML library for allocation of block not containing pointers to other areas.

size: number of bytes to allocate

xmlRealloc()

#define     xmlRealloc(ptr, size)

Wrapper for the realloc() function used in the XML library.

ptr: pointer to the existing allocated area
size: number of bytes to allocate

xmlMemStrdup()

#define     xmlMemStrdup(str)

Wrapper for the strdup() function, xmlStrdup() is usually preferred.

str: pointer to the existing string