From 3c908dca479ed50dca24b8593bca90e40dbde6b8 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sat, 19 Apr 2003 00:07:51 +0000 Subject: 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 --- DOCBparser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'DOCBparser.c') diff --git a/DOCBparser.c b/DOCBparser.c index 232c5a54..5a811cbc 100644 --- a/DOCBparser.c +++ b/DOCBparser.c @@ -2682,7 +2682,7 @@ docbParseSGMLAttribute(docbParserCtxtPtr ctxt, const xmlChar stop) { * allocate a translation buffer. */ buffer_size = DOCB_PARSER_BIG_BUFFER_SIZE; - buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar)); + buffer = (xmlChar *) xmlMallocAtomic(buffer_size * sizeof(xmlChar)); if (buffer == NULL) { xmlGenericError(xmlGenericErrorContext, "docbParseSGMLAttribute: malloc failed"); @@ -3195,7 +3195,7 @@ docbParsePI(xmlParserCtxtPtr ctxt) { } } - buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar)); + buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlGenericError(xmlGenericErrorContext, "malloc of %d byte failed\n", size); @@ -3315,7 +3315,7 @@ docbParseComment(docbParserCtxtPtr ctxt) { ctxt->instate = XML_PARSER_COMMENT; SHRINK; SKIP(4); - buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar)); + buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlGenericError(xmlGenericErrorContext, "malloc of %d byte failed\n", size); -- cgit v1.2.1