mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
cleanup, creating a new legacy.c module, made sure make tests ran in
* Makefile.am: cleanup, creating a new legacy.c module, made sure make tests ran in reduced conditions * SAX.c SAX2.c configure.in entities.c globals.c parser.c parserInternals.c tree.c valid.c xlink.c xmlIO.c xmlcatalog.c xmlmemory.c xpath.c xmlmemory.c include/libxml/xmlversion.h.in: increased the modularization, allow to configure out validation code and legacy code, added a configuration option --with-minimum compiling only the mandatory code which then shrink to 200KB. Daniel
This commit is contained in:
17
xmlmemory.c
17
xmlmemory.c
@ -29,6 +29,7 @@
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* MEM_LIST:
|
||||
*
|
||||
@ -43,6 +44,9 @@
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
|
||||
static int xmlMemInitialized = 0;
|
||||
|
||||
#ifdef DEBUG_MEMORY_LOCATION
|
||||
void xmlMallocBreakpoint(void);
|
||||
|
||||
/************************************************************************
|
||||
@ -108,7 +112,6 @@ static unsigned long debugMaxMemSize = 0;
|
||||
static int block=0;
|
||||
static int xmlMemStopAtBlock = 0;
|
||||
static void *xmlMemTraceBlockAt = NULL;
|
||||
static int xmlMemInitialized = 0;
|
||||
#ifdef MEM_LIST
|
||||
static MEMHDR *memlist = NULL;
|
||||
#endif
|
||||
@ -712,6 +715,7 @@ static void debugmem_tag_error(void *p)
|
||||
|
||||
static FILE *xmlMemoryDumpFile = NULL;
|
||||
|
||||
#endif /* DEBUG_MEMORY_LOCATION */
|
||||
|
||||
/**
|
||||
* xmlMemoryDump:
|
||||
@ -722,6 +726,7 @@ static FILE *xmlMemoryDumpFile = NULL;
|
||||
void
|
||||
xmlMemoryDump(void)
|
||||
{
|
||||
#ifdef DEBUG_MEMORY_LOCATION
|
||||
FILE *dump;
|
||||
|
||||
if (debugMaxMemSize == 0)
|
||||
@ -734,6 +739,7 @@ xmlMemoryDump(void)
|
||||
xmlMemDisplay(xmlMemoryDumpFile);
|
||||
|
||||
if (dump != NULL) fclose(dump);
|
||||
#endif /* DEBUG_MEMORY_LOCATION */
|
||||
}
|
||||
|
||||
|
||||
@ -755,14 +761,15 @@ static int xmlInitMemoryDone = 0;
|
||||
int
|
||||
xmlInitMemory(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#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) {
|
||||
@ -775,6 +782,7 @@ xmlInitMemory(void)
|
||||
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
|
||||
}
|
||||
#endif
|
||||
#endif /* DEBUG_MEMORY_LOCATION */
|
||||
|
||||
#ifdef DEBUG_MEMORY
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
@ -783,8 +791,7 @@ xmlInitMemory(void)
|
||||
xmlMemInitialized = 1;
|
||||
xmlInitMemoryDone = 1;
|
||||
|
||||
ret = 0;
|
||||
return(ret);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user