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/nanohttp.c b/nanohttp.c
index 376660b..8c5f995 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -484,7 +484,7 @@
while (ctxt->state & XML_NANO_HTTP_READ) {
if (ctxt->in == NULL) {
- ctxt->in = (char *) xmlMalloc(65000 * sizeof(char));
+ ctxt->in = (char *) xmlMallocAtomic(65000 * sizeof(char));
if (ctxt->in == NULL) {
ctxt->last = -1;
xmlGenericError( xmlGenericErrorContext,
@@ -1125,7 +1125,7 @@
if (contentType && *contentType)
blen += strlen(*contentType) + 16;
blen += strlen(method) + strlen(ctxt->path) + 24;
- bp = xmlMalloc(blen);
+ bp = xmlMallocAtomic(blen);
if ( bp == NULL ) {
xmlNanoHTTPFreeCtxt( ctxt );
xmlGenericError( xmlGenericErrorContext,