ReactOS  0.4.14-dev-608-gd495a4f
xmlmemory.h File Reference
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/threads.h>
#include <libxml/globals.h>
Include dependency graph for xmlmemory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(XMLCALLxmlFreeFunc) (void *mem)
 
typedef voidLIBXML_ATTR_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc) (size_t size)
 
typedef void *(XMLCALLxmlReallocFunc) (void *mem, size_t size)
 
typedef char *(XMLCALLxmlStrdupFunc) (const char *str)
 

Functions

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 Documentation

◆ LIBXML_ATTR_ALLOC_SIZE

typedef void* LIBXML_ATTR_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size)

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.

◆ xmlFreeFunc

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: @mem: an already allocated block of memory

Signature for a free() implementation.

Definition at line 57 of file xmlmemory.h.

◆ xmlReallocFunc

typedef void*(XMLCALL * xmlReallocFunc) (void *mem, size_t size)

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

typedef char*(XMLCALL * xmlStrdupFunc) (const char *str)

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.

Function Documentation

◆ xmlCleanupMemory()

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.

Definition at line 1008 of file xmlmemory.c.

1008  {
1009 #ifdef DEBUG_MEMORY
1011  "xmlCleanupMemory()\n");
1012 #endif
1013  if (xmlMemInitialized == 0)
1014  return;
1015 
1017  xmlMemMutex = NULL;
1018  xmlMemInitialized = 0;
1019 #ifdef DEBUG_MEMORY
1021  "xmlCleanupMemory() Ok\n");
1022 #endif
1023 }
static int xmlMemInitialized
Definition: xmlmemory.c:51
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN void XMLCALL xmlFreeMutex(xmlMutexPtr tok)
Definition: threads.c:206
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlCleanupParser().

◆ xmlGcMemGet()

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 1151 of file xmlmemory.c.

1153  {
1154  if (freeFunc != NULL) *freeFunc = xmlFree;
1155  if (mallocFunc != NULL) *mallocFunc = xmlMalloc;
1156  if (mallocAtomicFunc != NULL) *mallocAtomicFunc = xmlMallocAtomic;
1157  if (reallocFunc != NULL) *reallocFunc = xmlRealloc;
1158  if (strdupFunc != NULL) *strdupFunc = xmlMemStrdup;
1159  return(0);
1160 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
smooth NULL
Definition: ftsmooth.c:416
XMLPUBVAR xmlReallocFunc xmlRealloc
Definition: globals.h:249
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBVAR xmlStrdupFunc xmlMemStrdup
Definition: globals.h:251
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247

◆ xmlGcMemSetup()

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 1107 of file xmlmemory.c.

1109  {
1110 #ifdef DEBUG_MEMORY
1112  "xmlGcMemSetup()\n");
1113 #endif
1114  if (freeFunc == NULL)
1115  return(-1);
1116  if (mallocFunc == NULL)
1117  return(-1);
1118  if (mallocAtomicFunc == NULL)
1119  return(-1);
1120  if (reallocFunc == NULL)
1121  return(-1);
1122  if (strdupFunc == NULL)
1123  return(-1);
1124  xmlFree = freeFunc;
1125  xmlMalloc = mallocFunc;
1126  xmlMallocAtomic = mallocAtomicFunc;
1127  xmlRealloc = reallocFunc;
1128  xmlMemStrdup = strdupFunc;
1129 #ifdef DEBUG_MEMORY
1131  "xmlGcMemSetup() Ok\n");
1132 #endif
1133  return(0);
1134 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBVAR xmlReallocFunc xmlRealloc
Definition: globals.h:249
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBVAR xmlStrdupFunc xmlMemStrdup
Definition: globals.h:251
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

◆ xmlInitMemory()

XMLPUBFUN int XMLCALL xmlInitMemory ( void  )

xmlInitMemory:

Initialize the memory layer.

Returns 0 on success

Definition at line 964 of file xmlmemory.c.

965 {
966 #ifdef HAVE_STDLIB_H
967  char *breakpoint;
968 #endif
969 #ifdef DEBUG_MEMORY
971  "xmlInitMemory()\n");
972 #endif
973  /*
974  This is really not good code (see Bug 130419). Suggestions for
975  improvement will be welcome!
976  */
977  if (xmlMemInitialized) return(-1);
978  xmlMemInitialized = 1;
980 
981 #ifdef HAVE_STDLIB_H
982  breakpoint = getenv("XML_MEM_BREAKPOINT");
983  if (breakpoint != NULL) {
985  }
986 #endif
987 #ifdef HAVE_STDLIB_H
988  breakpoint = getenv("XML_MEM_TRACE");
989  if (breakpoint != NULL) {
991  }
992 #endif
993 
994 #ifdef DEBUG_MEMORY
996  "xmlInitMemory() Ok\n");
997 #endif
998  return(0);
999 }
static int xmlMemInitialized
Definition: xmlmemory.c:51
static void * xmlMemTraceBlockAt
Definition: xmlmemory.c:120
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
static unsigned int xmlMemStopAtBlock
Definition: xmlmemory.c:119
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
void breakpoint(void)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
XMLPUBFUN xmlMutexPtr XMLCALL xmlNewMutex(void)
Definition: threads.c:177
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlInitParser(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemStrdupLoc(), and xmlReallocLoc().

◆ xmlMallocAtomicLoc()

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

Definition at line 238 of file xmlmemory.c.

239 {
240  MEMHDR *p;
241  void *ret;
242 
244 #ifdef DEBUG_MEMORY
246  "Malloc(%d)\n",size);
247 #endif
248 
249  TEST_POINT
250 
251  if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
253  "xmlMallocAtomicLoc : Unsigned overflow\n");
254  xmlMemoryDump();
255  return(NULL);
256  }
257 
259 
260  if (!p) {
262  "xmlMallocAtomicLoc : Out of free space\n");
263  xmlMemoryDump();
264  return(NULL);
265  }
266  p->mh_tag = MEMTAG;
267  p->mh_size = size;
268  p->mh_type = MALLOC_ATOMIC_TYPE;
269  p->mh_file = file;
270  p->mh_line = line;
272  p->mh_number = ++block;
273  debugMemSize += size;
274  debugMemBlocks++;
276 #ifdef MEM_LIST
277  debugmem_list_add(p);
278 #endif
280 
281 #ifdef DEBUG_MEMORY
283  "Malloc(%d) Ok\n",size);
284 #endif
285 
286  if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
287 
288  ret = HDR_2_CLIENT(p);
289 
290  if (xmlMemTraceBlockAt == ret) {
292  "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt,
293  (long unsigned)size);
295  }
296 
297  TEST_POINT
298 
299  return(ret);
300 }
static unsigned int block
Definition: xmlmemory.c:118
#define MEMTAG
Definition: xmlmemory.c:81
static int xmlMemInitialized
Definition: xmlmemory.c:51
#define TEST_POINT
Definition: xmlmemory.c:133
static void * xmlMemTraceBlockAt
Definition: xmlmemory.c:120
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
#define HDR_2_CLIENT(a)
Definition: xmlmemory.c:115
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
static unsigned int xmlMemStopAtBlock
Definition: xmlmemory.c:119
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int xmlInitMemory(void)
Definition: xmlmemory.c:964
void xmlMemoryDump(void)
Definition: xmlmemory.c:931
static unsigned long debugMemBlocks
Definition: xmlmemory.c:53
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
#define RESERVE_SIZE
Definition: xmlmemory.c:109
int ret
char line[200]
Definition: main.c:97
#define MAX_SIZE_T
Definition: xmlmemory.c:112
void xmlMallocBreakpoint(void)
Definition: xmlmemory.c:145
#define malloc
Definition: debug_ros.c:4
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
#define MALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:86
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

◆ xmlMallocLoc()

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

Definition at line 162 of file xmlmemory.c.

163 {
164  MEMHDR *p;
165  void *ret;
166 
168 #ifdef DEBUG_MEMORY
170  "Malloc(%d)\n",size);
171 #endif
172 
173  TEST_POINT
174 
175  if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
177  "xmlMallocLoc : Unsigned overflow\n");
178  xmlMemoryDump();
179  return(NULL);
180  }
181 
183 
184  if (!p) {
186  "xmlMallocLoc : Out of free space\n");
187  xmlMemoryDump();
188  return(NULL);
189  }
190  p->mh_tag = MEMTAG;
191  p->mh_size = size;
192  p->mh_type = MALLOC_TYPE;
193  p->mh_file = file;
194  p->mh_line = line;
196  p->mh_number = ++block;
197  debugMemSize += size;
198  debugMemBlocks++;
200 #ifdef MEM_LIST
201  debugmem_list_add(p);
202 #endif
204 
205 #ifdef DEBUG_MEMORY
207  "Malloc(%d) Ok\n",size);
208 #endif
209 
210  if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
211 
212  ret = HDR_2_CLIENT(p);
213 
214  if (xmlMemTraceBlockAt == ret) {
216  "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt,
217  (long unsigned)size);
219  }
220 
221  TEST_POINT
222 
223  return(ret);
224 }
static unsigned int block
Definition: xmlmemory.c:118
#define MEMTAG
Definition: xmlmemory.c:81
static int xmlMemInitialized
Definition: xmlmemory.c:51
#define TEST_POINT
Definition: xmlmemory.c:133
static void * xmlMemTraceBlockAt
Definition: xmlmemory.c:120
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
#define HDR_2_CLIENT(a)
Definition: xmlmemory.c:115
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
static unsigned int xmlMemStopAtBlock
Definition: xmlmemory.c:119
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int xmlInitMemory(void)
Definition: xmlmemory.c:964
void xmlMemoryDump(void)
Definition: xmlmemory.c:931
static unsigned long debugMemBlocks
Definition: xmlmemory.c:53
#define MALLOC_TYPE
Definition: xmlmemory.c:83
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
#define RESERVE_SIZE
Definition: xmlmemory.c:109
int ret
char line[200]
Definition: main.c:97
#define MAX_SIZE_T
Definition: xmlmemory.c:112
void xmlMallocBreakpoint(void)
Definition: xmlmemory.c:145
#define malloc
Definition: debug_ros.c:4
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlMemMalloc(), and xmlReallocLoc().

◆ xmlMemBlocks()

XMLPUBFUN int XMLCALL xmlMemBlocks ( void  )

xmlMemBlocks:

Provides the number of memory areas currently allocated

Returns an int representing the number of blocks

Definition at line 603 of file xmlmemory.c.

603  {
604  int res;
605 
609  return(res);
610 }
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
static unsigned long debugMemBlocks
Definition: xmlmemory.c:53
GLuint res
Definition: glext.h:9613

◆ xmlMemDisplay()

XMLPUBFUN void XMLCALL xmlMemDisplay ( FILE fp)

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 756 of file xmlmemory.c.

757 {
758 #ifdef MEM_LIST
759  MEMHDR *p;
760  unsigned idx;
761  int nb = 0;
762 #if defined(HAVE_LOCALTIME) && defined(HAVE_STRFTIME)
763  time_t currentTime;
764  char buf[500];
765  struct tm * tstruct;
766 #endif
767 #endif
768  FILE *old_fp = fp;
769 
770  if (fp == NULL) {
771  fp = fopen(".memorylist", "w");
772  if (fp == NULL)
773  return;
774  }
775 
776 #ifdef MEM_LIST
777 #if defined(HAVE_LOCALTIME) && defined(HAVE_STRFTIME)
778  currentTime = time(NULL);
779  tstruct = localtime(&currentTime);
780  strftime(buf, sizeof(buf) - 1, "%I:%M:%S %p", tstruct);
781  fprintf(fp," %s\n\n", buf);
782 #endif
783 
784 
785  fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n",
787  fprintf(fp,"BLOCK NUMBER SIZE TYPE\n");
788  idx = 0;
790  p = memlist;
791  while (p) {
792  fprintf(fp,"%-5u %6lu %6lu ",idx++,p->mh_number,
793  (unsigned long)p->mh_size);
794  switch (p->mh_type) {
795  case STRDUP_TYPE:fprintf(fp,"strdup() in ");break;
796  case MALLOC_TYPE:fprintf(fp,"malloc() in ");break;
797  case REALLOC_TYPE:fprintf(fp,"realloc() in ");break;
798  case MALLOC_ATOMIC_TYPE:fprintf(fp,"atomicmalloc() in ");break;
799  case REALLOC_ATOMIC_TYPE:fprintf(fp,"atomicrealloc() in ");break;
800  default:
801  fprintf(fp,"Unknown memory block, may be corrupted");
803  if (old_fp == NULL)
804  fclose(fp);
805  return;
806  }
807  if (p->mh_file != NULL) fprintf(fp,"%s(%u)", p->mh_file, p->mh_line);
808  if (p->mh_tag != MEMTAG)
809  fprintf(fp," INVALID");
810  nb++;
811  if (nb < 100)
812  xmlMemContentShow(fp, p);
813  else
814  fprintf(fp," skip");
815 
816  fprintf(fp,"\n");
817  p = p->mh_next;
818  }
820 #else
821  fprintf(fp,"Memory list not compiled (MEM_LIST not defined !)\n");
822 #endif
823  if (old_fp == NULL)
824  fclose(fp);
825 }
#define MEMTAG
Definition: xmlmemory.c:81
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
#define REALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:87
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
__u16 time
Definition: mkdosfs.c:366
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
#define REALLOC_TYPE
Definition: xmlmemory.c:84
#define STRDUP_TYPE
Definition: xmlmemory.c:85
size_t CDECL strftime(char *str, size_t max, const char *format, const struct tm *mstm)
Definition: strftime.c:293
#define MALLOC_TYPE
Definition: xmlmemory.c:83
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
Definition: time.h:76
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
Definition: time.h:424
__kernel_time_t time_t
Definition: linux.h:252
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
#define MALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:86

Referenced by debugmem_tag_error(), and xmlMemoryDump().

◆ xmlMemDisplayLast()

XMLPUBFUN void XMLCALL xmlMemDisplayLast ( FILE fp,
long  nbBytes 
)

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 685 of file xmlmemory.c.

686 {
687 #ifdef MEM_LIST
688  MEMHDR *p;
689  unsigned idx;
690  int nb = 0;
691 #endif
692  FILE *old_fp = fp;
693 
694  if (nbBytes <= 0)
695  return;
696 
697  if (fp == NULL) {
698  fp = fopen(".memorylist", "w");
699  if (fp == NULL)
700  return;
701  }
702 
703 #ifdef MEM_LIST
704  fprintf(fp," Last %li MEMORY ALLOCATED : %lu, MAX was %lu\n",
705  nbBytes, debugMemSize, debugMaxMemSize);
706  fprintf(fp,"BLOCK NUMBER SIZE TYPE\n");
707  idx = 0;
709  p = memlist;
710  while ((p) && (nbBytes > 0)) {
711  fprintf(fp,"%-5u %6lu %6lu ",idx++,p->mh_number,
712  (unsigned long)p->mh_size);
713  switch (p->mh_type) {
714  case STRDUP_TYPE:fprintf(fp,"strdup() in ");break;
715  case MALLOC_TYPE:fprintf(fp,"malloc() in ");break;
716  case REALLOC_TYPE:fprintf(fp,"realloc() in ");break;
717  case MALLOC_ATOMIC_TYPE:fprintf(fp,"atomicmalloc() in ");break;
718  case REALLOC_ATOMIC_TYPE:fprintf(fp,"atomicrealloc() in ");break;
719  default:
720  fprintf(fp,"Unknown memory block, may be corrupted");
722  if (old_fp == NULL)
723  fclose(fp);
724  return;
725  }
726  if (p->mh_file != NULL) fprintf(fp,"%s(%u)", p->mh_file, p->mh_line);
727  if (p->mh_tag != MEMTAG)
728  fprintf(fp," INVALID");
729  nb++;
730  if (nb < 100)
731  xmlMemContentShow(fp, p);
732  else
733  fprintf(fp," skip");
734 
735  fprintf(fp,"\n");
736  nbBytes -= (unsigned long)p->mh_size;
737  p = p->mh_next;
738  }
740 #else
741  fprintf(fp,"Memory list not compiled (MEM_LIST not defined !)\n");
742 #endif
743  if (old_fp == NULL)
744  fclose(fp);
745 }
#define MEMTAG
Definition: xmlmemory.c:81
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
#define REALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:87
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
#define REALLOC_TYPE
Definition: xmlmemory.c:84
#define STRDUP_TYPE
Definition: xmlmemory.c:85
#define MALLOC_TYPE
Definition: xmlmemory.c:83
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
#define long
Definition: qsort.c:33
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
#define MALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:86

◆ xmlMemFree()

XMLPUBFUN void XMLCALL xmlMemFree ( void ptr)

xmlMemFree: @ptr: the memory block pointer

a free() equivalent, with error checking.

Definition at line 431 of file xmlmemory.c.

432 {
433  MEMHDR *p;
434  char *target;
435 #ifdef DEBUG_MEMORY
436  size_t size;
437 #endif
438 
439  if (ptr == NULL)
440  return;
441 
442  if (ptr == (void *) -1) {
444  "trying to free pointer from freed area\n");
445  goto error;
446  }
447 
448  if (xmlMemTraceBlockAt == ptr) {
450  "%p : Freed()\n", xmlMemTraceBlockAt);
452  }
453 
454  TEST_POINT
455 
456  target = (char *) ptr;
457 
458  p = CLIENT_2_HDR(ptr);
459  if (p->mh_tag != MEMTAG) {
460  Mem_Tag_Err(p);
461  goto error;
462  }
463  if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
464  p->mh_tag = ~MEMTAG;
465  memset(target, -1, p->mh_size);
467  debugMemSize -= p->mh_size;
468  debugMemBlocks--;
469 #ifdef DEBUG_MEMORY
470  size = p->mh_size;
471 #endif
472 #ifdef MEM_LIST
473  debugmem_list_delete(p);
474 #endif
476 
477  free(p);
478 
479  TEST_POINT
480 
481 #ifdef DEBUG_MEMORY
483  "Freed(%d) Ok\n", size);
484 #endif
485 
486  return;
487 
488 error:
490  "xmlMemFree(%p) error\n", ptr);
492  return;
493 }
#define MEMTAG
Definition: xmlmemory.c:81
#define error(str)
Definition: mkdosfs.c:1605
#define TEST_POINT
Definition: xmlmemory.c:133
#define free
Definition: debug_ros.c:5
static void * xmlMemTraceBlockAt
Definition: xmlmemory.c:120
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
#define CLIENT_2_HDR(a)
Definition: xmlmemory.c:114
static PVOID ptr
Definition: dispmode.c:27
static unsigned int xmlMemStopAtBlock
Definition: xmlmemory.c:119
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
static unsigned long debugMemBlocks
Definition: xmlmemory.c:53
#define Mem_Tag_Err(a)
Definition: xmlmemory.c:130
GLsizeiptr size
Definition: glext.h:5919
void xmlMallocBreakpoint(void)
Definition: xmlmemory.c:145
GLenum target
Definition: glext.h:7315
GLfloat GLfloat p
Definition: glext.h:8902
#define memset(x, y, z)
Definition: compat.h:39
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by myFreeFunc(), myMallocFunc(), myReallocFunc(), and xmlInitializeGlobalState().

◆ xmlMemGet()

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 1079 of file xmlmemory.c.

1080  {
1081  if (freeFunc != NULL) *freeFunc = xmlFree;
1082  if (mallocFunc != NULL) *mallocFunc = xmlMalloc;
1083  if (reallocFunc != NULL) *reallocFunc = xmlRealloc;
1084  if (strdupFunc != NULL) *strdupFunc = xmlMemStrdup;
1085  return(0);
1086 }
smooth NULL
Definition: ftsmooth.c:416
XMLPUBVAR xmlReallocFunc xmlRealloc
Definition: globals.h:249
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBVAR xmlStrdupFunc xmlMemStrdup
Definition: globals.h:251
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247

◆ xmlMemMalloc()

XMLPUBFUN void* XMLCALL xmlMemMalloc ( size_t  size)

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 311 of file xmlmemory.c.

312 {
313  return(xmlMallocLoc(size, "none", 0));
314 }
void * xmlMallocLoc(size_t size, const char *file, int line)
Definition: xmlmemory.c:162
GLsizeiptr size
Definition: glext.h:5919

Referenced by myMallocFunc(), and xmlInitializeGlobalState().

◆ xmlMemoryDump()

XMLPUBFUN void XMLCALL xmlMemoryDump ( void  )

xmlMemoryDump:

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

Definition at line 931 of file xmlmemory.c.

932 {
933 #ifdef MEM_LIST
934  FILE *dump;
935 
936  if (debugMaxMemSize == 0)
937  return;
938  dump = fopen(".memdump", "w");
939  if (dump == NULL)
940  xmlMemoryDumpFile = stderr;
941  else xmlMemoryDumpFile = dump;
942 
943  xmlMemDisplay(xmlMemoryDumpFile);
944 
945  if (dump != NULL) fclose(dump);
946 #endif /* MEM_LIST */
947 }
void xmlMemDisplay(FILE *fp)
Definition: xmlmemory.c:756
smooth NULL
Definition: ftsmooth.c:416
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
FILE * stderr
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
static void dump(const void *ptr, unsigned len)
Definition: msc.c:102

Referenced by main(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemStrdupLoc(), and xmlReallocLoc().

◆ xmlMemoryStrdup()

XMLPUBFUN char* XMLCALL xmlMemoryStrdup ( const char str)

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 572 of file xmlmemory.c.

572  {
573  return(xmlMemStrdupLoc(str, "none", 0));
574 }
const WCHAR * str
char * xmlMemStrdupLoc(const char *str, const char *file, int line)
Definition: xmlmemory.c:507

Referenced by myStrdupFunc(), and xmlInitializeGlobalState().

◆ xmlMemRealloc()

XMLPUBFUN void* XMLCALL xmlMemRealloc ( void ptr,
size_t  size 
)

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 420 of file xmlmemory.c.

420  {
421  return(xmlReallocLoc(ptr, size, "none", 0));
422 }
static PVOID ptr
Definition: dispmode.c:27
GLsizeiptr size
Definition: glext.h:5919
void * xmlReallocLoc(void *ptr, size_t size, const char *file, int line)
Definition: xmlmemory.c:329

Referenced by myReallocFunc(), and xmlInitializeGlobalState().

◆ xmlMemSetup()

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 1041 of file xmlmemory.c.

1042  {
1043 #ifdef DEBUG_MEMORY
1045  "xmlMemSetup()\n");
1046 #endif
1047  if (freeFunc == NULL)
1048  return(-1);
1049  if (mallocFunc == NULL)
1050  return(-1);
1051  if (reallocFunc == NULL)
1052  return(-1);
1053  if (strdupFunc == NULL)
1054  return(-1);
1055  xmlFree = freeFunc;
1056  xmlMalloc = mallocFunc;
1057  xmlMallocAtomic = mallocFunc;
1058  xmlRealloc = reallocFunc;
1059  xmlMemStrdup = strdupFunc;
1060 #ifdef DEBUG_MEMORY
1062  "xmlMemSetup() Ok\n");
1063 #endif
1064  return(0);
1065 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
XMLPUBVAR xmlReallocFunc xmlRealloc
Definition: globals.h:249
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBVAR xmlStrdupFunc xmlMemStrdup
Definition: globals.h:251
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by main().

◆ xmlMemShow()

XMLPUBFUN void XMLCALL xmlMemShow ( FILE fp,
int nr  ATTRIBUTE_UNUSED 
)

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 886 of file xmlmemory.c.

887 {
888 #ifdef MEM_LIST
889  MEMHDR *p;
890 #endif
891 
892  if (fp != NULL)
893  fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n",
895 #ifdef MEM_LIST
897  if (nr > 0) {
898  fprintf(fp,"NUMBER SIZE TYPE WHERE\n");
899  p = memlist;
900  while ((p) && nr > 0) {
901  fprintf(fp,"%6lu %6lu ",p->mh_number,(unsigned long)p->mh_size);
902  switch (p->mh_type) {
903  case STRDUP_TYPE:fprintf(fp,"strdup() in ");break;
904  case MALLOC_TYPE:fprintf(fp,"malloc() in ");break;
905  case MALLOC_ATOMIC_TYPE:fprintf(fp,"atomicmalloc() in ");break;
906  case REALLOC_TYPE:fprintf(fp,"realloc() in ");break;
907  case REALLOC_ATOMIC_TYPE:fprintf(fp,"atomicrealloc() in ");break;
908  default:fprintf(fp," ??? in ");break;
909  }
910  if (p->mh_file != NULL)
911  fprintf(fp,"%s(%u)", p->mh_file, p->mh_line);
912  if (p->mh_tag != MEMTAG)
913  fprintf(fp," INVALID");
914  xmlMemContentShow(fp, p);
915  fprintf(fp,"\n");
916  nr--;
917  p = p->mh_next;
918  }
919  }
921 #endif /* MEM_LIST */
922 }
#define MEMTAG
Definition: xmlmemory.c:81
ULONG nr
Definition: thread.c:7
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
#define REALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:87
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
#define REALLOC_TYPE
Definition: xmlmemory.c:84
#define STRDUP_TYPE
Definition: xmlmemory.c:85
#define MALLOC_TYPE
Definition: xmlmemory.c:83
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
#define MALLOC_ATOMIC_TYPE
Definition: xmlmemory.c:86

◆ xmlMemStrdupLoc()

XMLPUBFUN char* XMLCALL xmlMemStrdupLoc ( const char str,
const char file,
int  line 
)

Definition at line 507 of file xmlmemory.c.

508 {
509  char *s;
510  size_t size = strlen(str) + 1;
511  MEMHDR *p;
512 
514  TEST_POINT
515 
516  if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
518  "xmlMemStrdupLoc : Unsigned overflow\n");
519  xmlMemoryDump();
520  return(NULL);
521  }
522 
524  if (!p) {
525  goto error;
526  }
527  p->mh_tag = MEMTAG;
528  p->mh_size = size;
529  p->mh_type = STRDUP_TYPE;
530  p->mh_file = file;
531  p->mh_line = line;
533  p->mh_number = ++block;
534  debugMemSize += size;
535  debugMemBlocks++;
537 #ifdef MEM_LIST
538  debugmem_list_add(p);
539 #endif
541 
542  s = (char *) HDR_2_CLIENT(p);
543 
544  if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
545 
546  strcpy(s,str);
547 
548  TEST_POINT
549 
550  if (xmlMemTraceBlockAt == s) {
552  "%p : Strdup() Ok\n", xmlMemTraceBlockAt);
554  }
555 
556  return(s);
557 
558 error:
559  return(NULL);
560 }
static unsigned int block
Definition: xmlmemory.c:118
#define MEMTAG
Definition: xmlmemory.c:81
#define error(str)
Definition: mkdosfs.c:1605
static int xmlMemInitialized
Definition: xmlmemory.c:51
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TEST_POINT
Definition: xmlmemory.c:133
static void * xmlMemTraceBlockAt
Definition: xmlmemory.c:120
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
#define HDR_2_CLIENT(a)
Definition: xmlmemory.c:115
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
static unsigned int xmlMemStopAtBlock
Definition: xmlmemory.c:119
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
int xmlInitMemory(void)
Definition: xmlmemory.c:964
void xmlMemoryDump(void)
Definition: xmlmemory.c:931
static unsigned long debugMemBlocks
Definition: xmlmemory.c:53
#define STRDUP_TYPE
Definition: xmlmemory.c:85
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
#define RESERVE_SIZE
Definition: xmlmemory.c:109
char line[200]
Definition: main.c:97
#define MAX_SIZE_T
Definition: xmlmemory.c:112
GLdouble s
Definition: gl.h:2039
void xmlMallocBreakpoint(void)
Definition: xmlmemory.c:145
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define malloc
Definition: debug_ros.c:4
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlMemoryStrdup().

◆ xmlMemUsed()

XMLPUBFUN int XMLCALL xmlMemUsed ( void  )

xmlMemUsed:

Provides the amount of memory currently allocated

Returns an int representing the amount of memory allocated.

Definition at line 585 of file xmlmemory.c.

585  {
586  int res;
587 
589  res = debugMemSize;
591  return(res);
592 }
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
GLuint res
Definition: glext.h:9613

Referenced by myMallocFunc(), myReallocFunc(), and myStrdupFunc().

◆ xmlReallocLoc()

XMLPUBFUN void* XMLCALL xmlReallocLoc ( void ptr,
size_t  size,
const char file,
int  line 
)

Definition at line 329 of file xmlmemory.c.

330 {
331  MEMHDR *p, *tmp;
332  unsigned long number;
333 #ifdef DEBUG_MEMORY
334  size_t oldsize;
335 #endif
336 
337  if (ptr == NULL)
338  return(xmlMallocLoc(size, file, line));
339 
341  TEST_POINT
342 
343  p = CLIENT_2_HDR(ptr);
344  number = p->mh_number;
346  if (p->mh_tag != MEMTAG) {
347  Mem_Tag_Err(p);
348  goto error;
349  }
350  p->mh_tag = ~MEMTAG;
352  debugMemSize -= p->mh_size;
353  debugMemBlocks--;
354 #ifdef DEBUG_MEMORY
355  oldsize = p->mh_size;
356 #endif
357 #ifdef MEM_LIST
358  debugmem_list_delete(p);
359 #endif
361 
362  if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
364  "xmlReallocLoc : Unsigned overflow\n");
365  xmlMemoryDump();
366  return(NULL);
367  }
368 
369  tmp = (MEMHDR *) realloc(p,RESERVE_SIZE+size);
370  if (!tmp) {
371  free(p);
372  goto error;
373  }
374  p = tmp;
375  if (xmlMemTraceBlockAt == ptr) {
377  "%p : Realloced(%lu -> %lu) Ok\n",
378  xmlMemTraceBlockAt, (long unsigned)p->mh_size,
379  (long unsigned)size);
381  }
382  p->mh_tag = MEMTAG;
383  p->mh_number = number;
384  p->mh_type = REALLOC_TYPE;
385  p->mh_size = size;
386  p->mh_file = file;
387  p->mh_line = line;
389  debugMemSize += size;
390  debugMemBlocks++;
392 #ifdef MEM_LIST
393  debugmem_list_add(p);
394 #endif
396 
397  TEST_POINT
398 
399 #ifdef DEBUG_MEMORY
401  "Realloced(%d to %d) Ok\n", oldsize, size);
402 #endif
403  return(HDR_2_CLIENT(p));
404 
405 error:
406  return(NULL);
407 }
#define realloc
Definition: debug_ros.c:6
#define MEMTAG
Definition: xmlmemory.c:81
#define error(str)
Definition: mkdosfs.c:1605
static int xmlMemInitialized
Definition: xmlmemory.c:51
#define TEST_POINT
Definition: xmlmemory.c:133
#define free
Definition: debug_ros.c:5
static void * xmlMemTraceBlockAt
Definition: xmlmemory.c:120
static unsigned long debugMemSize
Definition: xmlmemory.c:52
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:257
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:229
#define HDR_2_CLIENT(a)
Definition: xmlmemory.c:115
static xmlMutexPtr xmlMemMutex
Definition: xmlmemory.c:55
static size_t double number
Definition: printf.c:69
#define CLIENT_2_HDR(a)
Definition: xmlmemory.c:114
static PVOID ptr
Definition: dispmode.c:27
static unsigned int xmlMemStopAtBlock
Definition: xmlmemory.c:119
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
#define REALLOC_TYPE
Definition: xmlmemory.c:84
Definition: parser.c:48
int xmlInitMemory(void)
Definition: xmlmemory.c:964
void xmlMemoryDump(void)
Definition: xmlmemory.c:931
static unsigned long debugMemBlocks
Definition: xmlmemory.c:53
void * xmlMallocLoc(size_t size, const char *file, int line)
Definition: xmlmemory.c:162
#define Mem_Tag_Err(a)
Definition: xmlmemory.c:130
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
#define RESERVE_SIZE
Definition: xmlmemory.c:109
char line[200]
Definition: main.c:97
#define MAX_SIZE_T
Definition: xmlmemory.c:112
void xmlMallocBreakpoint(void)
Definition: xmlmemory.c:145
GLfloat GLfloat p
Definition: glext.h:8902
static unsigned long debugMaxMemSize
Definition: xmlmemory.c:54
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362
Definition: fci.c:126

Referenced by xmlMemRealloc().