Commit 5ab479b0 authored by William M. Brack's avatar William M. Brack
Browse files

fixed problem when configuring using --with-thread-alloc

* configure.in, xmlmemory.c, globals.c: fixed problem when
  configuring using --with-thread-alloc
parent 4da70f38
Thu Jun 10 20:57:48 HKT 2004 William Brack <wbrack@mmm.com.hk>
* configure.in, xmlmemory.c, globals.c: fixed problem when
configuring using --with-thread-alloc
Wed Jun 9 16:31:24 CEST 2004 Igor Zlatkovic <igor@zlatkovic.com>
 
* win32/configure.js win32/Makefile.* minor changes for the new
......
......@@ -71,6 +71,12 @@ void xmlCleanupGlobals()
/*
* Memory allocation routines
*/
#undef xmlFree
#undef xmlMalloc
#undef xmlMallocAtomic
#undef xmlMemStrdup
#undef xmlRealloc
#if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
#ifndef __DEBUG_MEMORY_ALLOC__
extern void xmlMemFree(void *ptr);
......@@ -163,12 +169,6 @@ xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
#undef xmlDeregisterNodeDefaultValue
#undef xmlLastError
#undef xmlFree
#undef xmlMalloc
#undef xmlMallocAtomic
#undef xmlMemStrdup
#undef xmlRealloc
#undef xmlParserInputBufferCreateFilenameValue
#undef xmlOutputBufferCreateFilenameValue
/**
......@@ -716,6 +716,58 @@ __xmlLastError(void) {
return (&xmlGetGlobalState()->xmlLastError);
}
/*
* The following memory routines were apparently lost at some point,
* and were re-inserted at this point on June 10, 2004. Hope it's
* the right place for them :-)
*/
#if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
#undef xmlMalloc
xmlMallocFunc *
__xmlMalloc(void){
if (IS_MAIN_THREAD)
return (&xmlMalloc);
else
return (&xmlGetGlobalState()->xmlMalloc);
}
#undef xmlMallocAtomic
xmlMallocFunc *
__xmlMallocAtomic(void){
if (IS_MAIN_THREAD)
return (&xmlMallocAtomic);
else
return (&xmlGetGlobalState()->xmlMallocAtomic);
}
#undef xmlRealloc
xmlReallocFunc *
__xmlRealloc(void){
if (IS_MAIN_THREAD)
return (&xmlRealloc);
else
return (&xmlGetGlobalState()->xmlRealloc);
}
#undef xmlFree
xmlFreeFunc *
__xmlFree(void){
if (IS_MAIN_THREAD)
return (&xmlFree);
else
return (&xmlGetGlobalState()->xmlFree);
}
xmlStrdupFunc *
__xmlMemStrdup(void){
if (IS_MAIN_THREAD)
return (&xmlMemStrdup);
else
return (&xmlGetGlobalState()->xmlMemStrdup);
}
#endif
/*
* Everything starting from the line below is
* Automatically generated by build_glob.py.
......
......@@ -42,8 +42,8 @@
#endif
#endif
#include <libxml/globals.h> /* must come before xmlmemory.h */
#include <libxml/xmlmemory.h>
#include <libxml/globals.h>
#include <libxml/xmlerror.h>
#include <libxml/threads.h>
......@@ -60,7 +60,7 @@ void xmlMallocBreakpoint(void);
* *
************************************************************************/
#if !defined(LIBXML_THREAD_ENABLED) && !defined(LIBXML_THREAD_ALLOC_ENABLED)
#ifdef xmlMalloc
#undef xmlMalloc
#endif
......@@ -70,7 +70,7 @@ void xmlMallocBreakpoint(void);
#ifdef xmlMemStrdup
#undef xmlMemStrdup
#endif
#endif
/*
* Each of the blocks allocated begin with a header containing informations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment