| typedef void(XMLCALL * | xmlFreeFunc |
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. DEBUG_MEMORY_LOCATION:
DEBUG_MEMORY_LOCATION should be activated only when debugging libxml i.e. if libxml has been configured with --with-debug-mem too. xmlFreeFunc: Signature for a free() implementation.
| typedef void *(XMLCALL * | xmlMallocFunc |
xmlMallocFunc: Signature for a malloc() implementation.
Returns a pointer to the newly allocated block or NULL in case of error.
| typedef void *(XMLCALL * | xmlReallocFunc |
xmlReallocFunc: Signature for a realloc() implementation.
Returns a pointer to the newly reallocated block or NULL in case of error.
| typedef char *(XMLCALL * | xmlStrdupFunc |
xmlStrdupFunc: Signature for an strdup() implementation.
Returns the copy of the string or NULL in case of error.
| XMLPUBFUN int XMLCALL | xmlMemSetup | ( | xmlFreeFunc | freeFunc, |
| xmlMallocFunc | mallocFunc, | |||
| xmlReallocFunc | reallocFunc, | |||
| xmlStrdupFunc | strdupFunc | |||
| ) | ||||
| XMLPUBFUN int XMLCALL | xmlMemGet | ( | xmlFreeFunc * | freeFunc, |
| xmlMallocFunc * | mallocFunc, | |||
| xmlReallocFunc * | reallocFunc, | |||
| xmlStrdupFunc * | strdupFunc | |||
| ) | ||||
| XMLPUBFUN int XMLCALL | xmlGcMemSetup | ( | xmlFreeFunc | freeFunc, |
| xmlMallocFunc | mallocFunc, | |||
| xmlMallocFunc | mallocAtomicFunc, | |||
| xmlReallocFunc | reallocFunc, | |||
| xmlStrdupFunc | strdupFunc | |||
| ) | ||||
| XMLPUBFUN int XMLCALL | xmlGcMemGet | ( | xmlFreeFunc * | freeFunc, |
| xmlMallocFunc * | mallocFunc, | |||
| xmlMallocFunc * | mallocAtomicFunc, | |||
| xmlReallocFunc * | reallocFunc, | |||
| xmlStrdupFunc * | strdupFunc | |||
| ) | ||||
| XMLPUBFUN int XMLCALL | xmlInitMemory | ( | void | ) |
xmlInitMemory:
Initialize the memory layer.
Returns 0 on success
OOM: maybe possible -- during calls to standard library (???)
| XMLPUBFUN void XMLCALL | xmlCleanupMemory | ( | void | ) |
xmlCleanupMemory:
Free up all the memory associated with memorys
OOM: never
| XMLPUBFUN int XMLCALL | xmlMemUsed | ( | void | ) |
xmlMemUsed:
Provides the amount of memory currently allocated
Returns an int representing the amount of memory allocated.
| XMLPUBFUN void XMLCALL | xmlMemDisplay | ( | FILE * | fp | ) |
xmlMemDisplay: show in-extenso the memory blocks allocated
| Parameters | |
|---|---|
| fp | a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist |
| XMLPUBFUN void XMLCALL | xmlMemShow | ( | FILE * | fp, |
| int | nr | |||
| ) | ||||
xmlMemShow: show a show display of the memory allocated, and dump the nr last allocated areas which were not freed
| Parameters | |
|---|---|
| fp | a FILE descriptor used as the output file |
| nr | number of entries to dump |
| XMLPUBFUN void XMLCALL | xmlMemoryDump | ( | void | ) |
xmlMemoryDump:
Dump in-extenso the memory blocks allocated to the file .memorylist
| XMLPUBFUN void *XMLCALL | xmlMemRealloc | ( | void * | ptr, |
| size_t | size | |||
| ) | ||||
xmlMemRealloc: a realloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
| Parameters | |
|---|---|
| ptr | the initial memory block pointer |
| size | an int specifying the size in byte to allocate. |
| XMLPUBFUN void XMLCALL | xmlMemFree | ( | void * | ptr | ) |
xmlMemFree: a free() equivalent, with error checking.
| Parameters | |
|---|---|
| ptr | the memory block pointer |
| XMLPUBFUN char *XMLCALL | xmlMemoryStrdup | ( | const char * | str | ) |
xmlMemoryStrdup: a strdup() equivalent, with logging of the allocation info.
Returns a pointer to the new string or NULL if allocation error occurred.
| Parameters | |
|---|---|
| str | the initial string pointer |
| XMLPUBFUN void *XMLCALL | xmlMallocLoc | ( | size_t | size, |
| const char * | file, | |||
| int | line | |||
| ) | ||||
xmlMallocLoc: a malloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
| Parameters | |
|---|---|
| size | an int specifying the size in byte to allocate. |
| file | the file name or NULL |
| line | the line number |
| XMLPUBFUN void *XMLCALL | xmlReallocLoc | ( | void * | ptr, |
| size_t | size, | |||
| const char * | file, | |||
| int | line | |||
| ) | ||||
xmlReallocLoc: a realloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
| Parameters | |
|---|---|
| ptr | the initial memory block pointer |
| size | an int specifying the size in byte to allocate. |
| file | the file name or NULL |
| line | the line number |
| XMLPUBFUN void *XMLCALL | xmlMallocAtomicLoc | ( | size_t | size, |
| const char * | file, | |||
| int | line | |||
| ) | ||||
xmlMallocAtomicLoc: a malloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
| Parameters | |
|---|---|
| size | an int specifying the size in byte to allocate. |
| file | the file name or NULL |
| line | the line number |
| XMLPUBFUN char *XMLCALL | xmlMemStrdupLoc | ( | const char * | str, |
| const char * | file, | |||
| int | line | |||
| ) | ||||
xmlMemStrdupLoc: a strdup() equivalent, with logging of the allocation info.
Returns a pointer to the new string or NULL if allocation error occurred.
| Parameters | |
|---|---|
| str | the initial string pointer |
| file | the file name or NULL |
| line | the line number |