added xmlMallocAtomic() to be used when allocating blocks which do not
* DOCBparser.c HTMLparser.c c14n.c catalog.c encoding.c globals.c
nanohttp.c parser.c parserInternals.c relaxng.c tree.c uri.c
xmlmemory.c xmlreader.c xmlregexp.c xpath.c xpointer.c
include/libxml/globals.h include/libxml/xmlmemory.h: added
xmlMallocAtomic() to be used when allocating blocks which
do not contains pointers, add xmlGcMemSetup() and xmlGcMemGet()
to allow registering the full set of functions needed by
a garbage collecting allocator like libgc, ref #109944
Daniel
diff --git a/catalog.c b/catalog.c
index a9dc3a4..dcf255f 100644
--- a/catalog.c
+++ b/catalog.c
@@ -867,7 +867,7 @@
return (NULL);
}
#endif
- content = xmlMalloc(size + 10);
+ content = xmlMallocAtomic(size + 10);
if (content == NULL) {
xmlGenericError(xmlGenericErrorContext,
"malloc of %d byte failed\n", size + 10);
@@ -1955,7 +1955,7 @@
} else {
stop = ' ';
}
- buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar));
if (buf == NULL) {
xmlGenericError(xmlGenericErrorContext,
"malloc of %d byte failed\n", size);