Eneboo - Documentación para desarrolladores
|
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/threads.h>
#include <libxml/globals.h>
Ir al código fuente de este archivo.
'typedefs' | |
typedef void(XMLCALL * | xmlFreeFunc )(void *mem) |
typedef void * | LIBXML_ATTR_ALLOC_SIZE (1) XMLCALL *xmlMallocFunc)(size_t size) |
typedef void *(XMLCALL * | xmlReallocFunc )(void *mem, size_t size) |
typedef char *(XMLCALL * | xmlStrdupFunc )(const char *str) |
Funciones | |
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) |
XMLPUBFUN void XMLCALL | xmlCleanupMemory (void) |
XMLPUBFUN int XMLCALL | xmlMemUsed (void) |
XMLPUBFUN int XMLCALL | xmlMemBlocks (void) |
XMLPUBFUN void XMLCALL | xmlMemDisplay (FILE *fp) |
XMLPUBFUN void XMLCALL | xmlMemDisplayLast (FILE *fp, long nbBytes) |
XMLPUBFUN void XMLCALL | xmlMemShow (FILE *fp, int nr) |
XMLPUBFUN void XMLCALL | xmlMemoryDump (void) |
XMLPUBFUN void *XMLCALL | xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1) |
XMLPUBFUN void *XMLCALL | xmlMemRealloc (void *ptr, size_t size) |
XMLPUBFUN void XMLCALL | xmlMemFree (void *ptr) |
XMLPUBFUN char *XMLCALL | xmlMemoryStrdup (const char *str) |
XMLPUBFUN void *XMLCALL | xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1) |
XMLPUBFUN void *XMLCALL | xmlReallocLoc (void *ptr, size_t size, const char *file, int line) |
XMLPUBFUN void *XMLCALL | xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1) |
XMLPUBFUN char *XMLCALL | xmlMemStrdupLoc (const char *str, const char *file, int line) |
typedef void* LIBXML_ATTR_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size) |
xmlMallocFunc: : the size requested in bytes
Signature for a malloc() implementation.
Returns a pointer to the newly allocated block or NULL in case of error.
typedef void(XMLCALL * xmlFreeFunc)(void *mem) |
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: : an already allocated block of memory
Signature for a free() implementation.
typedef void*(XMLCALL * xmlReallocFunc)(void *mem, size_t size) |
xmlReallocFunc: : an already allocated block of memory : the new size requested in bytes
Signature for a realloc() implementation.
Returns a pointer to the newly reallocated block or NULL in case of error.
typedef char*(XMLCALL * xmlStrdupFunc)(const char *str) |
xmlStrdupFunc: : a zero terminated string
Signature for an strdup() implementation.
Returns the copy of the string or NULL in case of error.
XMLPUBFUN void XMLCALL xmlCleanupMemory | ( | void | ) |
xmlCleanupMemory:
Free up all the memory allocated by the library for its own use. This should not be called by user level code.
XMLPUBFUN int XMLCALL xmlGcMemGet | ( | xmlFreeFunc * | freeFunc, |
xmlMallocFunc * | mallocFunc, | ||
xmlMallocFunc * | mallocAtomicFunc, | ||
xmlReallocFunc * | reallocFunc, | ||
xmlStrdupFunc * | strdupFunc | ||
) |
xmlGcMemGet: : place to save the free() function in use : place to save the malloc() function in use : place to save the atomic malloc() function in use : place to save the realloc() function in use : place to save the strdup() function in use
Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators
Returns 0 on success
XMLPUBFUN int XMLCALL xmlGcMemSetup | ( | xmlFreeFunc | freeFunc, |
xmlMallocFunc | mallocFunc, | ||
xmlMallocFunc | mallocAtomicFunc, | ||
xmlReallocFunc | reallocFunc, | ||
xmlStrdupFunc | strdupFunc | ||
) |
xmlGcMemSetup: : the free() function to use : the malloc() function to use : the malloc() function to use for atomic allocations : the realloc() function to use : the strdup() function to use
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 ?
Returns 0 on success
XMLPUBFUN int XMLCALL xmlInitMemory | ( | void | ) |
xmlInitMemory:
Initialize the memory layer.
Returns 0 on success
XMLPUBFUN int XMLCALL xmlMemBlocks | ( | void | ) |
xmlMemBlocks:
Provides the number of memory areas currently allocated
Returns an int representing the number of blocks
XMLPUBFUN void XMLCALL xmlMemDisplay | ( | FILE * | fp | ) |
xmlMemDisplay: : a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist
show in-extenso the memory blocks allocated
XMLPUBFUN void XMLCALL xmlMemDisplayLast | ( | FILE * | fp, |
long | nbBytes | ||
) |
xmlMemDisplayLast: : a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist : the amount of memory to dump
the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.
XMLPUBFUN void XMLCALL xmlMemFree | ( | void * | ptr | ) |
xmlMemFree: : the memory block pointer
a free() equivalent, with error checking.
XMLPUBFUN int XMLCALL xmlMemGet | ( | xmlFreeFunc * | freeFunc, |
xmlMallocFunc * | mallocFunc, | ||
xmlReallocFunc * | reallocFunc, | ||
xmlStrdupFunc * | strdupFunc | ||
) |
xmlMemGet: : place to save the free() function in use : place to save the malloc() function in use : place to save the realloc() function in use : place to save the strdup() function in use
Provides the memory access functions set currently in use
Returns 0 on success
XMLPUBFUN void* XMLCALL xmlMemMalloc | ( | size_t | size | ) |
xmlMemMalloc: : an int specifying the size in byte to allocate.
a malloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
XMLPUBFUN void XMLCALL xmlMemoryDump | ( | void | ) |
xmlMemoryDump:
Dump in-extenso the memory blocks allocated to the file .memorylist
XMLPUBFUN char* XMLCALL xmlMemoryStrdup | ( | const char * | str | ) |
xmlMemoryStrdup: : the initial string pointer
a strdup() equivalent, with logging of the allocation info.
Returns a pointer to the new string or NULL if allocation error occurred.
XMLPUBFUN void* XMLCALL xmlMemRealloc | ( | void * | ptr, |
size_t | size | ||
) |
xmlMemRealloc: : the initial memory block pointer : an int specifying the size in byte to allocate.
a realloc() equivalent, with logging of the allocation info.
Returns a pointer to the allocated area or NULL in case of lack of memory.
XMLPUBFUN int XMLCALL xmlMemSetup | ( | xmlFreeFunc | freeFunc, |
xmlMallocFunc | mallocFunc, | ||
xmlReallocFunc | reallocFunc, | ||
xmlStrdupFunc | strdupFunc | ||
) |
xmlMemSetup: : the free() function to use : the malloc() function to use : the realloc() function to use : the strdup() function to use
Override the default memory access functions with a new set This has to be called before any other libxml routines !
Should this be blocked if there was already some allocations done ?
Returns 0 on success
XMLPUBFUN void XMLCALL xmlMemShow | ( | FILE * | fp, |
int nr | ATTRIBUTE_UNUSED | ||
) |
xmlMemShow: : a FILE descriptor used as the output file : number of entries to dump
show a show display of the memory allocated, and dump the last allocated areas which were not freed
XMLPUBFUN char* XMLCALL xmlMemStrdupLoc | ( | const char * | str, |
const char * | file, | ||
int | line | ||
) |
XMLPUBFUN int XMLCALL xmlMemUsed | ( | void | ) |
xmlMemUsed:
Provides the amount of memory currently allocated
Returns an int representing the amount of memory allocated.