fixed problem when configuring using --with-thread-alloc
* configure.in, xmlmemory.c, globals.c: fixed problem when
configuring using --with-thread-alloc
diff --git a/globals.c b/globals.c
index 79b4a14..2105157 100644
--- a/globals.c
+++ b/globals.c
@@ -71,6 +71,12 @@
/*
* 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 @@
#undef xmlDeregisterNodeDefaultValue
#undef xmlLastError
-#undef xmlFree
-#undef xmlMalloc
-#undef xmlMallocAtomic
-#undef xmlMemStrdup
-#undef xmlRealloc
-
#undef xmlParserInputBufferCreateFilenameValue
#undef xmlOutputBufferCreateFilenameValue
/**
@@ -717,6 +717,58 @@
}
/*
+ * 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.
* Do not modify the previous line.