http://swpat.ffii.org/
Action against software patents
http://www.gnome.org/
Gnome2 Logo
http://www.w3.org/Status
W3C Logo
http://www.redhat.com/
Red Hat Logo
http://xmlsoft.org/
Made with Libxml2 Logo
Module xmlmemory from libxml2
API Menu
../index.html
Main Menu
../docs.html
Developer Menu
../examples/index.html
Code Examples
index.html
API Menu
libxml-parser.html
Parser API
libxml-tree.html
Tree API
libxml-xmlreader.html
Reader API
../guidelines.html
XML Guidelines
../ChangeLog.html
ChangeLog
API Indexes
../APIchunk0.html
Alphabetic
../APIconstructors.html
Constructors
../APIfunctions.html
Functions/Types
../APIfiles.html
Modules
../APIsymbols.html
Symbols
Related links
http://mail.gnome.org/archives/xml/
Mail archive
http://xmlsoft.org/XSLT/
XSLT libxslt
http://phd.cs.unibo.it/gdome2/
DOM gdome2
http://www.aleksey.com/xmlsec/
XML-DSig xmlsec
ftp://xmlsoft.org/
FTP
http://www.zlatkovic.com/projects/libxml/
Windows binaries
http://www.blastwave.org/packages.php/libxml2
Solaris binaries
http://www.explain.com.au/oss/libxml2xslt.html
MacOsX binaries
http://libxmlplusplus.sourceforge.net/
C++ bindings
http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4
PHP bindings
http://sourceforge.net/projects/libxml2-pas/
Pascal bindings
http://rubyforge.org/projects/xml-tools/
Ruby bindings
http://tclxml.sourceforge.net/
Tcl bindings
http://bugzilla.gnome.org/buglist.cgi?product=libxml2
Bug Tracker
libxml-xmlexports.html
Prev
libxml-xmlexports.html
xmlexports
index.html
Up
index.html
API documentation
../index.html
Home
../index.html
The XML C parser and toolkit of Gnome
libxml-xmlmodule.html
xmlmodule
libxml-xmlmodule.html
Next
provides interfaces for the memory allocator, including debugging capabilities.
Table of Contents
#define
#DEBUG_MEMORY
DEBUG_MEMORY
Variable
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
xmlMalloc
Variable
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
xmlMallocAtomic
Variable
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
xmlMemStrdup
Variable
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
xmlRealloc
void
#xmlCleanupMemory
xmlCleanupMemory
(void)
Function type:
#xmlFreeFunc
xmlFreeFunc
void
#xmlFreeFunc
xmlFreeFunc
(void * mem)
int
#xmlGcMemGet
xmlGcMemGet
(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
* freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
* mallocFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
* mallocAtomicFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
* reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
* strdupFunc)
int
#xmlGcMemSetup
xmlGcMemSetup
(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
mallocFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
mallocAtomicFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
strdupFunc)
int
#xmlInitMemory
xmlInitMemory
(void)
void *
#xmlMallocAtomicLoc
xmlMallocAtomicLoc
(size_t size,
const char * file,
int line)
Function type:
#xmlMallocFunc
xmlMallocFunc
void *
#xmlMallocFunc
xmlMallocFunc
(size_t size)
void *
#xmlMallocLoc
xmlMallocLoc
(size_t size,
const char * file,
int line)
int
#xmlMemBlocks
xmlMemBlocks
(void)
void
#xmlMemDisplay
xmlMemDisplay
(FILE * fp)
void
#xmlMemFree
xmlMemFree
(void * ptr)
int
#xmlMemGet
xmlMemGet
(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
* freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
* mallocFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
* reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
* strdupFunc)
void *
#xmlMemMalloc
xmlMemMalloc
(size_t size)
void *
#xmlMemRealloc
xmlMemRealloc
(void * ptr,
size_t size)
int
#xmlMemSetup
xmlMemSetup
(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
mallocFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
strdupFunc)
void
#xmlMemShow
xmlMemShow
(FILE * fp,
int nr)
char *
#xmlMemStrdupLoc
xmlMemStrdupLoc
(const char * str,
const char * file,
int line)
int
#xmlMemUsed
xmlMemUsed
(void)
void
#xmlMemoryDump
xmlMemoryDump
(void)
char *
#xmlMemoryStrdup
xmlMemoryStrdup
(const char * str)
Function type:
#xmlReallocFunc
xmlReallocFunc
void *
#xmlReallocFunc
xmlReallocFunc
(void * mem,
size_t size)
void *
#xmlReallocLoc
xmlReallocLoc
(void * ptr,
size_t size,
const char * file,
int line)
Function type:
#xmlStrdupFunc
xmlStrdupFunc
char *
#xmlStrdupFunc
xmlStrdupFunc
(const char * str)
Description
Macro: DEBUG_MEMORY
#define DEBUG_MEMORY
libxml-xmlmemory.html#DEBUG_MEMORY
DEBUG_MEMORY
replaces the allocator with a collect and debug shell to the libc allocator.
libxml-xmlmemory.html#DEBUG_MEMORY
DEBUG_MEMORY
should only be activated when debugging libxml i.e. if libxml has been configured with --with-debug-mem too. #define DEBUG_MEMORY_FREED #define
libxml-xmlversion.html#DEBUG_MEMORY_LOCATION
DEBUG_MEMORY_LOCATION
Function: xmlCleanupMemory
void	xmlCleanupMemory		(void)
Free up all the memory allocated by the library for its own use. This should not be called by user level code.
Function type: xmlFreeFunc
Function type: xmlFreeFunc
void	xmlFreeFunc			(void * mem)
Signature for a free() implementation.
mem
:
an already allocated block of memory
Function: xmlGcMemGet
int	xmlGcMemGet			(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
* freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
* mallocFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
* mallocAtomicFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
* reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
* strdupFunc)
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
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
Returns
:
0 on success
Function: xmlGcMemSetup
int	xmlGcMemSetup			(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
mallocFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
mallocAtomicFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
strdupFunc)
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 ?
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
Returns
:
0 on success
Function: xmlInitMemory
int	xmlInitMemory			(void)
Initialize the memory layer.
Returns
:
0 on success
Function: xmlMallocAtomicLoc
void *	xmlMallocAtomicLoc		(size_t 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
line
:
the line number
Returns
:
a pointer to the allocated area or NULL in case of lack of memory.
Function type: xmlMallocFunc
Function type: xmlMallocFunc
void *	xmlMallocFunc			(size_t size)
Signature for a malloc() implementation.
size
:
the size requested in bytes
Returns
:
a pointer to the newly allocated block or NULL in case of error.
Function: xmlMallocLoc
void *	xmlMallocLoc			(size_t 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
line
:
the line number
Returns
:
a pointer to the allocated area or NULL in case of lack of memory.
Function: xmlMemBlocks
int	xmlMemBlocks			(void)
Provides the number of memory areas currently allocated
Returns
:
an int representing the number of blocks
Function: 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
Function: xmlMemFree
void	xmlMemFree			(void * ptr)
a free() equivalent, with error checking.
ptr
:
the memory block pointer
Function: xmlMemGet
int	xmlMemGet			(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
* freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
* mallocFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
* reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
* strdupFunc)
Provides the memory access functions set currently in use
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
Returns
:
0 on success
Function: xmlMemMalloc
void *	xmlMemMalloc			(size_t size)
a malloc() equivalent, with logging of the allocation info.
size
:
an int specifying the size in byte to allocate.
Returns
:
a pointer to the allocated area or NULL in case of lack of memory.
Function: xmlMemRealloc
void *	xmlMemRealloc			(void * ptr,
size_t 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.
Returns
:
a pointer to the allocated area or NULL in case of lack of memory.
Function: xmlMemSetup
int	xmlMemSetup			(
libxml-xmlmemory.html#xmlFreeFunc
xmlFreeFunc
freeFunc,
libxml-xmlmemory.html#xmlMallocFunc
xmlMallocFunc
mallocFunc,
libxml-xmlmemory.html#xmlReallocFunc
xmlReallocFunc
reallocFunc,
libxml-xmlmemory.html#xmlStrdupFunc
xmlStrdupFunc
strdupFunc)
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 ?
freeFunc
:
the free() function to use
mallocFunc
:
the malloc() function to use
reallocFunc
:
the realloc() function to use
strdupFunc
:
the strdup() function to use
Returns
:
0 on success
Function: 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
Function: xmlMemStrdupLoc
char *	xmlMemStrdupLoc			(const char * str,
const char * file,
int line)
a strdup() equivalent, with logging of the allocation info.
str
:
the initial string pointer
file
:
the file name or NULL
line
:
the line number
Returns
:
a pointer to the new string or NULL if allocation error occurred.
Function: xmlMemUsed
int	xmlMemUsed			(void)
Provides the amount of memory currently allocated
Returns
:
an int representing the amount of memory allocated.
Function: xmlMemoryDump
void	xmlMemoryDump			(void)
Dump in-extenso the memory blocks allocated to the file .memorylist
Function: xmlMemoryStrdup
char *	xmlMemoryStrdup			(const char * str)
a strdup() equivalent, with logging of the allocation info.
str
:
the initial string pointer
Returns
:
a pointer to the new string or NULL if allocation error occurred.
Function type: xmlReallocFunc
Function type: 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
Returns
:
a pointer to the newly reallocated block or NULL in case of error.
Function: xmlReallocLoc
void *	xmlReallocLoc			(void * ptr,
size_t 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
:
the line number
Returns
:
a pointer to the allocated area or NULL in case of lack of memory.
Function type: xmlStrdupFunc
Function type: 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.
../bugs.html
Daniel Veillard
