Whole document tree
    

Whole document tree

xmlmemory

xmlmemory

Name

xmlmemory -- 

Synopsis



#define     NO_DEBUG_MEMORY
void        xmlFree                         (void *ptr);
void*       xmlMalloc                       (int size);
void*       xmlRealloc                      (void *ptr,
                                             int size);
char*       xmlMemStrdup                    (const char *str);
int         xmlInitMemory                   (void);
int         xmlMemUsed                      (void);
void        xmlMemoryDump                   (void);
void        xmlMemDisplay                   (FILE *fp);
void        xmlMemShow                      (FILE *fp,
                                             int nr);
#define     DEBUG_MEMORY_LOCATION
#define     DEBUG_MEMORY
#define     MEM_LIST
void*       xmlMallocLoc                    (int size,
                                             const char *file,
                                             int line);
void*       xmlReallocLoc                   (void *ptr,
                                             int size,
                                             const char *file,
                                             int line);
char*       xmlMemStrdupLoc                 (const char *str,
                                             const char *file,
                                             int line);

Description

Details

NO_DEBUG_MEMORY

#define NO_DEBUG_MEMORY


xmlFree ()

void        xmlFree                         (void *ptr);

a free() equivalent, with error checking.

ptr : the memory block pointer


xmlMalloc ()

void*       xmlMalloc                       (int size);

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

size : an int specifying the size in byte to allocate.


xmlRealloc ()

void*       xmlRealloc                      (void *ptr,
                                             int size);

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

ptr : the initial memory block pointer
size : an int specifying the size in byte to allocate.


xmlMemStrdup ()

char*       xmlMemStrdup                    (const char *str);

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

str : 
Returns :a pointer to the new string or NULL if allocation error occured.


xmlInitMemory ()

int         xmlInitMemory                   (void);

Initialize the memory layer.

Returns :0 on success


xmlMemUsed ()

int         xmlMemUsed                      (void);

returns the amount of memory currenly allocated

Returns :an int representing the amount of memory allocated.


xmlMemoryDump ()

void        xmlMemoryDump                   (void);

Dump in-extenso the memory blocks allocated to the file .memorylist


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


xmlMemShow ()

void        xmlMemShow                      (FILE *fp,
                                             int nr);

show a show display of the memory allocated, and dump the nr last allocated areas which were not freed

fp : a FILE descriptor used as the output file
nr : number of entries to dump


DEBUG_MEMORY_LOCATION

#define DEBUG_MEMORY_LOCATION


DEBUG_MEMORY

#define DEBUG_MEMORY


MEM_LIST

#define MEM_LIST /* keep a list of all the allocated memory blocks */


xmlMallocLoc ()

void*       xmlMallocLoc                    (int 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 file: the line number
line :


xmlReallocLoc ()

void*       xmlReallocLoc                   (void *ptr,
                                             int size,
                                             const char *file,
                                             int line);

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

ptr : the initial memory block pointer
size : an int specifying the size in byte to allocate.
file : the file name or NULL
line :


xmlMemStrdupLoc ()

char*       xmlMemStrdupLoc                 (const char *str,
                                             const char *file,
                                             int line);

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

str : 
file : the file name or NULL
line : 
Returns :a pointer to the new string or NULL if allocation error occured.