Eneboo - Documentación para desarrolladores
Clases | 'defines' | 'typedefs' | Funciones
Referencia del Archivo src/libdigidoc/libxml2/xmlmemory.c
#include "libxml.h"
#include <string.h>
#include <libxml/globals.h>
#include <libxml/xmlmemory.h>
#include <libxml/xmlerror.h>
#include <libxml/threads.h>
#include "elfgcchack.h"

Clases

struct  memnod

'defines'

#define IN_LIBXML
#define MEMTAG   0x5aa5
#define MALLOC_TYPE   1
#define REALLOC_TYPE   2
#define STRDUP_TYPE   3
#define MALLOC_ATOMIC_TYPE   4
#define REALLOC_ATOMIC_TYPE   5
#define ALIGN_SIZE   sizeof(double)
#define HDR_SIZE   sizeof(MEMHDR)
#define RESERVE_SIZE
#define CLIENT_2_HDR(a)   ((MEMHDR *) (((char *) (a)) - RESERVE_SIZE))
#define HDR_2_CLIENT(a)   ((void *) (((char *) (a)) + RESERVE_SIZE))
#define Mem_Tag_Err(a)   debugmem_tag_error(a);
#define TEST_POINT
#define bottom_xmlmemory

'typedefs'

typedef struct memnod MEMHDR

Funciones

void xmlMallocBreakpoint (void)
void * xmlMallocLoc (size_t size, const char *file, int line)
void * xmlMallocAtomicLoc (size_t size, const char *file, int line)
void * xmlMemMalloc (size_t size)
void * xmlReallocLoc (void *ptr, size_t size, const char *file, int line)
void * xmlMemRealloc (void *ptr, size_t size)
void xmlMemFree (void *ptr)
char * xmlMemStrdupLoc (const char *str, const char *file, int line)
char * xmlMemoryStrdup (const char *str)
int xmlMemUsed (void)
int xmlMemBlocks (void)
void xmlMemDisplayLast (FILE *fp, long nbBytes)
void xmlMemDisplay (FILE *fp)
void xmlMemShow (FILE *fp, int nr ATTRIBUTE_UNUSED)
void xmlMemoryDump (void)
int xmlInitMemory (void)
void xmlCleanupMemory (void)
int xmlMemSetup (xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc)
int xmlMemGet (xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc, xmlReallocFunc *reallocFunc, xmlStrdupFunc *strdupFunc)
int xmlGcMemSetup (xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlMallocFunc mallocAtomicFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc)
int xmlGcMemGet (xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc, xmlMallocFunc *mallocAtomicFunc, xmlReallocFunc *reallocFunc, xmlStrdupFunc *strdupFunc)

Documentación de los 'defines'

#define ALIGN_SIZE   sizeof(double)
#define bottom_xmlmemory
#define CLIENT_2_HDR (   a)    ((MEMHDR *) (((char *) (a)) - RESERVE_SIZE))
#define HDR_2_CLIENT (   a)    ((void *) (((char *) (a)) + RESERVE_SIZE))
#define HDR_SIZE   sizeof(MEMHDR)
#define IN_LIBXML
#define MALLOC_ATOMIC_TYPE   4
#define MALLOC_TYPE   1
#define Mem_Tag_Err (   a)    debugmem_tag_error(a);
#define MEMTAG   0x5aa5
#define REALLOC_ATOMIC_TYPE   5
#define REALLOC_TYPE   2
#define RESERVE_SIZE
Valor:
#define STRDUP_TYPE   3
#define TEST_POINT

Documentación de los 'typedefs'

typedef struct memnod MEMHDR

Documentación de las funciones

void 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.

int 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

int 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

int xmlInitMemory ( void  )

xmlInitMemory:

Initialize the memory layer.

Returns 0 on success

void* xmlMallocAtomicLoc ( size_t  size,
const char *  file,
int  line 
)
void xmlMallocBreakpoint ( void  )

xmlMallocBreakpoint:

Breakpoint to use in conjunction with xmlMemStopAtBlock. When the block number reaches the specified value this function is called. One need to add a breakpoint to it to get the context in which the given block is allocated.

void* xmlMallocLoc ( size_t  size,
const char *  file,
int  line 
)
int xmlMemBlocks ( void  )

xmlMemBlocks:

Provides the number of memory areas currently allocated

Returns an int representing the number of blocks

void 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

void 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.

void xmlMemFree ( void *  ptr)

xmlMemFree: : the memory block pointer

a free() equivalent, with error checking.

int 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

void* 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.

void xmlMemoryDump ( void  )

xmlMemoryDump:

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

char* 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.

void* 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.

int 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

void 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

char* xmlMemStrdupLoc ( const char *  str,
const char *  file,
int  line 
)
int xmlMemUsed ( void  )

xmlMemUsed:

Provides the amount of memory currently allocated

Returns an int representing the amount of memory allocated.

void* xmlReallocLoc ( void *  ptr,
size_t  size,
const char *  file,
int  line 
)
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'