1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

better fix, avoids breaking the python bindings Daniel

* xmlmemory.c: better fix, avoids breaking the python bindings
Daniel
This commit is contained in:
Daniel Veillard
2003-09-29 10:55:05 +00:00
parent fb43bd6fc9
commit c064b476c8
2 changed files with 9 additions and 14 deletions

View File

@ -1,3 +1,7 @@
Mon Sep 29 12:53:56 CEST 2003 Daniel Veillard <daniel@veillard.com>
* xmlmemory.c: better fix, avoids breaking the python bindings
Mon Sep 29 11:21:33 CEST 2003 Daniel Veillard <daniel@veillard.com>
* xmlmemory.c: fix a compilation problem when configuring

View File

@ -36,9 +36,11 @@
* keep track of all allocated blocks for error reporting
* Always build the memory list !
*/
#ifdef DEBUG_MEMORY_LOCATION
#ifndef MEM_LIST
#define MEM_LIST /* keep a list of all the allocated memory blocks */
#endif
#endif
#include <libxml/xmlmemory.h>
#include <libxml/globals.h>
@ -48,7 +50,6 @@ static int xmlMemInitialized = 0;
static unsigned long debugMemSize = 0;
static unsigned long debugMaxMemSize = 0;
#ifdef DEBUG_MEMORY_LOCATION
void xmlMallocBreakpoint(void);
/************************************************************************
@ -669,8 +670,6 @@ static void debugmem_tag_error(void *p)
static FILE *xmlMemoryDumpFile = NULL;
#endif /* DEBUG_MEMORY_LOCATION */
/**
* xmlMemShow:
* @fp: a FILE descriptor used as the output file
@ -681,18 +680,15 @@ static FILE *xmlMemoryDumpFile = NULL;
*/
void
xmlMemShow(FILE *fp, int nr)
xmlMemShow(FILE *fp, int nr ATTRIBUTE_UNUSED)
{
#ifdef DEBUG_MEMORY_LOCATION
#ifdef MEM_LIST
MEMHDR *p;
#endif
#endif /* DEBUG_MEMORY_LOCATION */
if (fp != NULL)
fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n",
debugMemSize, debugMaxMemSize);
#ifdef DEBUG_MEMORY_LOCATION
#ifdef MEM_LIST
if (nr > 0) {
fprintf(fp,"NUMBER SIZE TYPE WHERE\n");
@ -718,7 +714,6 @@ xmlMemShow(FILE *fp, int nr)
}
}
#endif /* MEM_LIST */
#endif /* DEBUG_MEMORY_LOCATION */
}
/**
@ -730,7 +725,7 @@ xmlMemShow(FILE *fp, int nr)
void
xmlMemoryDump(void)
{
#ifdef DEBUG_MEMORY_LOCATION
#ifdef MEM_LIST
FILE *dump;
if (debugMaxMemSize == 0)
@ -743,7 +738,7 @@ xmlMemoryDump(void)
xmlMemDisplay(xmlMemoryDumpFile);
if (dump != NULL) fclose(dump);
#endif /* DEBUG_MEMORY_LOCATION */
#endif /* MEM_LIST */
}
@ -765,15 +760,12 @@ static int xmlInitMemoryDone = 0;
int
xmlInitMemory(void)
{
#ifdef DEBUG_MEMORY_LOCATION
#ifdef HAVE_STDLIB_H
char *breakpoint;
#endif
#endif
if (xmlInitMemoryDone) return(-1);
#ifdef DEBUG_MEMORY_LOCATION
#ifdef HAVE_STDLIB_H
breakpoint = getenv("XML_MEM_BREAKPOINT");
if (breakpoint != NULL) {
@ -786,7 +778,6 @@ xmlInitMemory(void)
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
}
#endif
#endif /* DEBUG_MEMORY_LOCATION */
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,