ReactOS 0.4.16-dev-336-gb667d82
|
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/threads.h>
#include <libxml/globals.h>
Go to the source code of this file.
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) |
xmlMallocFunc: @size: the size requested in bytes
Signature for a malloc() implementation.
Returns a pointer to the newly allocated block or NULL in case of error.
Definition at line 66 of file xmlmemory.h.
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: @mem: an already allocated block of memory
Signature for a free() implementation.
Definition at line 57 of file xmlmemory.h.
xmlReallocFunc: @mem: an already allocated block of memory @size: 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.
Definition at line 77 of file xmlmemory.h.
xmlStrdupFunc: @str: a zero terminated string
Signature for an strdup() implementation.
Returns the copy of the string or NULL in case of error.
Definition at line 87 of file xmlmemory.h.
XML_DEPRECATED XMLPUBFUN void XMLCALL xmlCleanupMemory | ( | void | ) |
xmlCleanupMemory:
DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all.
Free up all the memory allocated by the library for its own use. This should not be called by user level code.
Definition at line 989 of file xmlmemory.c.
Referenced by xmlCleanupParser().
XMLPUBFUN int XMLCALL xmlGcMemGet | ( | xmlFreeFunc * | freeFunc, |
xmlMallocFunc * | mallocFunc, | ||
xmlMallocFunc * | mallocAtomicFunc, | ||
xmlReallocFunc * | reallocFunc, | ||
xmlStrdupFunc * | strdupFunc | ||
) |
xmlGcMemGet: @freeFunc: place to save the free() function in use @mallocFunc: place to save the malloc() function in use @mallocAtomicFunc: place to save the atomic malloc() function in use @reallocFunc: place to save the realloc() function in use @strdupFunc: 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
Definition at line 1132 of file xmlmemory.c.
XMLPUBFUN int XMLCALL xmlGcMemSetup | ( | xmlFreeFunc | freeFunc, |
xmlMallocFunc | mallocFunc, | ||
xmlMallocFunc | mallocAtomicFunc, | ||
xmlReallocFunc | reallocFunc, | ||
xmlStrdupFunc | strdupFunc | ||
) |
xmlGcMemSetup: @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
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
Definition at line 1088 of file xmlmemory.c.
XML_DEPRECATED XMLPUBFUN int XMLCALL xmlInitMemory | ( | void | ) |
xmlInitMemory:
DEPRECATED: This function will be made private. Call xmlInitParser to initialize the library.
Initialize the memory layer.
Returns 0 on success
Definition at line 946 of file xmlmemory.c.
Referenced by xmlInitParser(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemStrdupLoc(), and xmlReallocLoc().
Definition at line 221 of file xmlmemory.c.
Definition at line 145 of file xmlmemory.c.
Referenced by xmlMemMalloc(), and xmlReallocLoc().
xmlMemBlocks:
Provides the number of memory areas currently allocated
Returns an int representing the number of blocks
Definition at line 586 of file xmlmemory.c.
xmlMemDisplay: @fp: 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
Definition at line 739 of file xmlmemory.c.
Referenced by debugmem_tag_error(), and xmlMemoryDump().
xmlMemDisplayLast: @fp: a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist @nbBytes: 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.
Definition at line 668 of file xmlmemory.c.
xmlMemFree: @ptr: the memory block pointer
a free() equivalent, with error checking.
Definition at line 414 of file xmlmemory.c.
Referenced by myFreeFunc(), myMallocFunc(), myReallocFunc(), and xmlInitializeGlobalState().
XMLPUBFUN int XMLCALL xmlMemGet | ( | xmlFreeFunc * | freeFunc, |
xmlMallocFunc * | mallocFunc, | ||
xmlReallocFunc * | reallocFunc, | ||
xmlStrdupFunc * | strdupFunc | ||
) |
xmlMemGet: @freeFunc: place to save the free() function in use @mallocFunc: place to save the malloc() function in use @reallocFunc: place to save the realloc() function in use @strdupFunc: place to save the strdup() function in use
Provides the memory access functions set currently in use
Returns 0 on success
Definition at line 1060 of file xmlmemory.c.
xmlMemMalloc: @size: 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.
Definition at line 294 of file xmlmemory.c.
Referenced by myMallocFunc(), and xmlInitializeGlobalState().
xmlMemoryDump:
Dump in-extenso the memory blocks allocated to the file .memorylist
Definition at line 910 of file xmlmemory.c.
Referenced by main(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemStrdupLoc(), and xmlReallocLoc().
xmlMemoryStrdup: @str: 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.
Definition at line 555 of file xmlmemory.c.
Referenced by myStrdupFunc(), and xmlInitializeGlobalState().
xmlMemRealloc: @ptr: the initial memory block pointer @size: 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.
Definition at line 403 of file xmlmemory.c.
Referenced by myReallocFunc(), and xmlInitializeGlobalState().
XMLPUBFUN int XMLCALL xmlMemSetup | ( | xmlFreeFunc | freeFunc, |
xmlMallocFunc | mallocFunc, | ||
xmlReallocFunc | reallocFunc, | ||
xmlStrdupFunc | strdupFunc | ||
) |
xmlMemSetup: @freeFunc: the free() function to use @mallocFunc: the malloc() function to use @reallocFunc: the realloc() function to use @strdupFunc: 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
Definition at line 1022 of file xmlmemory.c.
Referenced by main().
xmlMemShow: @fp: a FILE descriptor used as the output file @nr: number of entries to dump
show a show display of the memory allocated, and dump the @nr last allocated areas which were not freed
Definition at line 865 of file xmlmemory.c.
Definition at line 490 of file xmlmemory.c.
Referenced by xmlMemoryStrdup().
xmlMemUsed:
Provides the amount of memory currently allocated
Returns an int representing the amount of memory allocated.
Definition at line 568 of file xmlmemory.c.
Referenced by myMallocFunc(), myReallocFunc(), and myStrdupFunc().
Definition at line 312 of file xmlmemory.c.
Referenced by xmlMemRealloc().