summaryrefslogtreecommitdiff
path: root/xmlmemory.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix pointer/int cast warnings on 64-bit WindowsNick Wellnhofer2017-10-091-1/+1
| | | | | | | | | | | On 64-bit Windows, `long` is 32 bits wide and can't hold a pointer. Switch to ptrdiff_t instead which should be the same size as a pointer on every somewhat sane platform without requiring C99 types like intptr_t. Fixes bug 788312. Thanks to J. Peter Mugaas for the report and initial patch.
* Fix cast-align warningsNick Wellnhofer2017-06-171-1/+1
| | | | | | | | | | | | | - Suppress warnings in xmlmemory.c by casting to 'void *'. - Remove unneeded cast in xmlschemas.c that caused a macro precedence error. - Add dummy fields to short structs in xmlschemas.c. This increases the size of the structs, but I can't see a better solution without using C11's _Alignof operator. There are still a couple of cast-align warnings in encoding.c. These are legitimate portability issues that can't be fixed without reworking the conversion functions.
* Fix copy-paste errors in error messagesNick Wellnhofer2017-06-111-3/+3
| | | | Thanks to David Kilzer for the review.
* Check for integer overflow in memory debug codeNick Wellnhofer2017-06-061-0/+21
| | | | | | Fixes bug 783026. Thanks to Pranjal Jumde for the report.
* Unsigned addition may overflow in xmlMallocAtomicLoc()David Kilzer2016-05-231-2/+10
| | | | | | | | | | | | | For https://bugzilla.gnome.org/show_bug.cgi?id=764616 This code is used only if turning memory allocation debug in configure with --with-mem-debug, which should never happen in real life, so not a serious issue. * xmlmemory.c: (MAX_SIZE_T): Macro to define maximum value of size_t. (xmlMallocAtomicLoc): Add bounds check. Fix description and use the correct function name in another error message.
* xmlMemUsed is not thread-safeMartin von Gagern2015-04-131-2/+12
| | | | | For https://bugzilla.gnome.org/show_bug.cgi?id=747437 just use the mutex to protect access to those variables
* xmlmemory: handle realloc properlyYegor Yefremov2014-10-131-3/+5
| | | | | | If realloc fails, free original pointer. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
* Remove a couple of dead conditionsGaurav Gupta2014-07-261-4/+1
| | | | For https://bugzilla.gnome.org/show_bug.cgi?id=733711
* Avoid Possible null pointer dereference in memory debug modeGaurav2014-05-091-2/+4
| | | | | Fix a use before check on pointer For https://bugzilla.gnome.org/show_bug.cgi?id=729849
* Big space and tab cleanupDaniel Veillard2012-09-111-1/+1
| | | | Remove all space before tabs and space and tabs at end of lines.
* xmlmemory: add a cast as size_t has no portable printf modifierStefan Kost2011-05-091-4/+7
| | | | Also use %lu as that is more appropriate for size_t.
* port patch from Marcus Meissner to add gcc checking for printf likeDaniel Veillard2009-01-181-3/+3
| | | | | | | | | | | | | | | * include/libxml/parser.h include/libxml/xmlwriter.h include/libxml/relaxng.h include/libxml/xmlversion.h.in include/libxml/xmlwin32version.h.in include/libxml/valid.h include/libxml/xmlschemas.h include/libxml/xmlerror.h: port patch from Marcus Meissner to add gcc checking for printf like functions parameters, should fix #65068 * doc/apibuild.py doc/*: modified the script accordingly and regenerated * xpath.c xmlmemory.c threads.c: fix a few warnings Daniel svn path=/trunk/; revision=3813
* add xmlMemDisplayLast to help debug incremental memory leaks, and someDaniel Veillard2008-07-301-35/+108
| | | | | | | | | | * include/libxml/xmlmemory.h xmlmemory.c: add xmlMemDisplayLast to help debug incremental memory leaks, and some cleanups * runxmlconf.c: use that new call and avoid ever touching the system catalog in the regression tests Daniel svn path=/trunk/; revision=3760
* xmlFree(NULL) should not crash in debug mode should fix #491651 DanielDaniel Veillard2007-10-301-0/+3
| | | | | | | | * xmlmemory.c: xmlFree(NULL) should not crash in debug mode should fix #491651 Daniel svn path=/trunk/; revision=3662
* fix comment on versions do not spend too much time digging in dumpedDaniel Veillard2006-10-111-2/+4
| | | | | | * include/libxml/xmlversion.h.in: fix comment on versions * xmlmemory.c: do not spend too much time digging in dumped memory Daniel
* fixed #169630 segfault in xmlMemDisplay DanielDaniel Veillard2005-05-081-0/+15
| | | | | * xmlmemory.c: fixed #169630 segfault in xmlMemDisplay Daniel
* added the call to the breakpoint routine when a monitored block isDaniel Veillard2005-04-141-0/+2
| | | | | | * xmlmemory.c: added the call to the breakpoint routine when a monitored block is reallocated or freed Daniel
* revamped the elfgcchack.h format to cope with gcc4 change of aliasingDaniel Veillard2005-04-011-0/+2
| | | | | | | | | | | * doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h format to cope with gcc4 change of aliasing allowed scopes, had to add extra informations to doc/libxml2-api.xml to separate the header from the c module source. * *.c: updated all c library files to add a #define bottom_xxx and reimport elfgcchack.h thereafter, and a bit of cleanups. * doc//* testapi.c: regenerated when rebuilding the API Daniel
* fixed ID deallocation problem based on patch from Steve Shepard fixes bugDaniel Veillard2004-12-101-1/+2
| | | | | | | | * valid.c: fixed ID deallocation problem based on patch from Steve Shepard fixes bug #160893 * xmlmemory.c: improving comment. * testapi.c: new test for xmlDictExists() is generated. Daniel
* adding xmlMemBlocks() work on generator of an automatic API regressionDaniel Veillard2004-11-021-0/+20
| | | | | | | | | | | * xmlmemory.c include/libxml/xmlmemory.h: adding xmlMemBlocks() * Makefile.am gentest.py testapi.c: work on generator of an automatic API regression test tool. * SAX2.c nanoftp.c parser.c parserInternals.c tree.c xmlIO.c xmlstring.c: various API hardeing changes as a result of running teh first set of automatic API regression tests. * test/slashdot16.xml: apparently missing from CVS, commited it Daniel
* added the routine xmlNanoHTTPContentLength to the external APIWilliam M. Brack2004-09-181-3/+3
| | | | | | | | | | | | * nanohttp.c, include/libxml/nanohttp.h: added the routine xmlNanoHTTPContentLength to the external API (bug151968). * parser.c: fixed unnecessary internal error message (bug152060); also changed call to strncmp over to xmlStrncmp. * encoding.c: fixed compilation warning (bug152307). * tree.c: fixed segfault in xmlCopyPropList (bug152368); fixed a couple of compilation warnings. * HTMLtree.c, debugXML.c, xmlmemory.c: fixed a few compilation warnings; no change to logic.
* applied a small fix from Steve Hay DanielDaniel Veillard2004-07-131-3/+3
| | | | | * xmlmemory.c: applied a small fix from Steve Hay Daniel
* some updates with memory debugging facilities while messing with libxsltDaniel Veillard2004-07-021-4/+28
| | | | | | | * xmlmemory.c python/libxml.c python/libxml2-python-api.xml: some updates with memory debugging facilities while messing with libxslt python bindings Daniel
* applied patch from Stéphane Bidoul to fix some Python bindingsDaniel Veillard2004-07-011-1/+29
| | | | | | | | | | * python/libxml.c python/generator.py python/libxml.py python/libxml2-python-api.xml python/libxml2class.txt: applied patch from Stéphane Bidoul to fix some Python bindings initialization, then had to change the parserCleanup() to handle memory released there. * xmlmemory.c: added more debugging comments. Daniel
* fixed problem when configuring using --with-thread-allocWilliam M. Brack2004-06-101-3/+3
| | | | | * configure.in, xmlmemory.c, globals.c: fixed problem when configuring using --with-thread-alloc
* make xmlReallocLoc() accept NULL pointerAleksey Sanin2004-01-221-2/+3
|
* applied suggestion from Miloslav Trmac (see Bug 130419) and eliminatedWilliam M. Brack2004-01-041-5/+5
| | | | | | | | | | * xmlmemory.c: applied suggestion from Miloslav Trmac (see Bug 130419) and eliminated xmlInitMemoryDone. More improvement needed. * xml2-config.in: added an additional flag (--exec-prefix) to allow library directory to be different from include directory (Bug 129558).
* found and fixed a bug misallocating some non blank text node strings fromDaniel Veillard2004-01-021-0/+1
| | | | | | | | * SAX2.c: found and fixed a bug misallocating some non blank text node strings from the dictionnary. * xmlmemory.c: fixed a problem with the memory debug mutex release. Daniel
* Fixed memory leak reported by Dave Beckett Removed spurious commentWilliam M. Brack2003-12-301-0/+14
| | | | | | | | | | * parser.c, xmlmemory.c, include/libxml/xmlmemory.h: Fixed memory leak reported by Dave Beckett * xmlschemas.c: Removed spurious comment reported on the mailing list * xinclude.c, xpath.c, xpointer.c, libxml/include/xpointer.h: Further work on Bug 129967 concerning xpointer range handling and range-to function; much better, but still not complete
* enhanced by adding mutex to protect global structures in a multi-threadingWilliam M. Brack2003-11-291-14/+34
| | | | | | | | | | | | | | * xmlmemory.c: enhanced by adding mutex to protect global structures in a multi-threading environment. This fixed some random errors on the Threads regression tests. * encoding.c, include/libxml/encoding.h: Enhanced the handling of UTF-16, UTF-16LE and UTF-16BE encodings. Now UTF-16 output is handled internally by default, with proper BOM and UTF-16LE encoding. Native UTF-16LE and UTF-16BE encoding will not generate BOM on output, and will be automatically recognized on input. * test/utf16lebom.xml, test/utf16bebom.xml, result/utf16?ebom*: added regression tests for above.
* Okay this is scary but it is just adding a configure option to disableDaniel Veillard2003-09-291-0/+2
| | | | | | | | | | | | | | | | | | * HTMLtree.c SAX2.c c14n.c catalog.c configure.in debugXML.c encoding.c entities.c nanoftp.c nanohttp.c parser.c relaxng.c testAutomata.c testC14N.c testHTML.c testRegexp.c testRelax.c testSchemas.c testXPath.c threads.c tree.c valid.c xmlIO.c xmlcatalog.c xmllint.c xmlmemory.c xmlreader.c xmlschemas.c example/gjobread.c include/libxml/HTMLtree.h include/libxml/c14n.h include/libxml/catalog.h include/libxml/debugXML.h include/libxml/entities.h include/libxml/nanohttp.h include/libxml/relaxng.h include/libxml/tree.h include/libxml/valid.h include/libxml/xmlIO.h include/libxml/xmlschemas.h include/libxml/xmlversion.h.in include/libxml/xpathInternals.h python/libxml.c: Okay this is scary but it is just adding a configure option to disable output, this touches most of the files. Daniel
* better fix, avoids breaking the python bindings DanielDaniel Veillard2003-09-291-14/+5
| | | | | * xmlmemory.c: better fix, avoids breaking the python bindings Daniel
* fix a compilation problem when configuring with debug but withoutDaniel Veillard2003-09-291-48/+52
| | | | | | * xmlmemory.c: fix a compilation problem when configuring with debug but without mem-debug Daniel
* cleanup, creating a new legacy.c module, made sure make tests ran inDaniel Veillard2003-09-281-5/+12
| | | | | | | | | | | | | * Makefile.am: cleanup, creating a new legacy.c module, made sure make tests ran in reduced conditions * SAX.c SAX2.c configure.in entities.c globals.c parser.c parserInternals.c tree.c valid.c xlink.c xmlIO.c xmlcatalog.c xmlmemory.c xpath.c xmlmemory.c include/libxml/xmlversion.h.in: increased the modularization, allow to configure out validation code and legacy code, added a configuration option --with-minimum compiling only the mandatory code which then shrink to 200KB. Daniel
* small changes to syntax to get rid of compiler warnings. No changes toWilliam M. Brack2003-08-051-4/+0
| | | | | | | | * error.c HTMLparser.c testC14N.c testHTML.c testURI.c xmlcatalog.c xmlmemory.c xmlreader.c xmlschemastypes.c python/libxml.c include/libxml/xmlmemory.h: small changes to syntax to get rid of compiler warnings. No changes to logic.
* integrated the Out Of Memory test from Havoc Pennington #109368 a lot ofDaniel Veillard2003-04-241-0/+2
| | | | | | | | | | | | * Makefile.am testOOM.c testOOMlib.[ch] : integrated the Out Of Memory test from Havoc Pennington #109368 * SAX.c parser.c parserInternals.c tree.c uri.c valid.c xmlmemory.c xmlreader.c xmlregexp.c include/libxml/tree.h include/libxml/parser.h: a lot of memory allocation cleanups based on the results of the OOM testing * check-relaxng-test-suite2.py: seems I forgot to commit the script. Daniel
* added xmlMallocAtomic() to be used when allocating blocks which do notDaniel Veillard2003-04-191-1/+138
| | | | | | | | | | | | * 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
* new API building Python script, does the C parsing directly, generates aDaniel Veillard2002-12-111-6/+6
| | | | | | | | | | | | | | | * doc/apibuild.py doc/libxml2-api.xml doc/Makefile.am: new API building Python script, does the C parsing directly, generates a better API description including structure fieds defs and enums. Still a couple of bugs, but good enough for the python wrappers now. * DOCBparser.c SAX.c nanohttp.c parser.c parserInternals.c tree.c valid.c xmlIO.c xmlmemory.c xmlreader.c xmlregexp.c xmlschemas.c include/libxml/schemasInternals.h include/libxml/tree.h: more cleanup based on the python analysis script reports. * libxml.spec.in: make sure the API XML description is part of the devel package. Daniel
* code cleanup, especially the function comments. fixed a small bug whenDaniel Veillard2002-12-101-11/+12
| | | | | | | | | | * DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c: code cleanup, especially the function comments. * tree.c: fixed a small bug when freeing nodes which are XInclude ones. Daniel
* fixed configure for MPE/iX from Markus Henke fixed initialization problemsDaniel Veillard2002-03-281-0/+3
| | | | | | | | * configure.in: fixed configure for MPE/iX from Markus Henke * xmlmemory.c: fixed initialization problems * xpath.c: another set of patches from Richard Jinks this fixes "make XPathtests" on linux Daniel
* preparing 2.4.18 updated and rebuilt the web site implement the newLIBXML_2_4_18Daniel Veillard2002-03-181-0/+1
| | | | | | | | | | | | | * configure.in: preparing 2.4.18 * doc/*: updated and rebuilt the web site * *.c libxml.h: implement the new IN_LIBXML scheme discussed with the Windows and Cygwin maintainers. * parser.c: humm, changed the way the SAX parser work when xmlSubstituteEntitiesDefault(1) is set, it will then do the entity registration and loading by itself in case the user provided SAX getEntity() returns NULL. * testSAX.c: added --noent to test the behaviour. Daniel
* humm, changed the way the SAX parser work whenDaniel Veillard2002-03-181-0/+2
| | | | | | | | | * parser.c: humm, changed the way the SAX parser work when xmlSubstituteEntitiesDefault(1) is set, it will then do the entity registration and loading by itself in case the user provided SAX getEntity() returns NULL. * testSAX.c: added --noent to test the behaviour. Daniel
* avoid a warning bug #71594 DanielDaniel Veillard2002-02-151-1/+1
| | | | | * xmlmemory.c: avoid a warning bug #71594 Daniel
* Jesse Perry provided a patch to remove a few warning on alpha/Tru64 DanielDaniel Veillard2002-02-131-3/+4
| | | | | | * xmlmemory.c: Jesse Perry provided a patch to remove a few warning on alpha/Tru64 Daniel
* Tentatively fixed #69655 , make compiling with -Wredundant-decls clean.Daniel Veillard2002-02-101-3/+6
| | | | | | | | | | | | * HTMLtree.c Makefile.am build_glob.py configure.in debugXML.c globals.c parser.c threads.c tree.c valid.c xmlmemory.c xpath.c xpointer.c include/libxml/globals.h include/libxml/parser.h include/libxml/parserInternals.h include/libxml/tree.h include/libxml/xmlmemory.h include/libxml/xpathInternals.h: Tentatively fixed #69655 , make compiling with -Wredundant-decls clean. * python/libxml.c: fixed a warning. Daniel
* cleanup the extension function lookup always compile the list DanielDaniel Veillard2002-02-061-2/+9
| | | | | | * python/TODO python/libxml.c: cleanup the extension function lookup * xmlmemory.c include/libxml/xmlmemory.h: always compile the list Daniel
* Build a new version hopefully near complete and fully documented of theDaniel Veillard2002-01-221-1/+1
| | | | | | | | | | | | | | | * doc/libxml2-api.xml doc/parsedecl.py: Build a new version hopefully near complete and fully documented of the API in XML * HTMLtree.c SAX.c debugXML.c error.c globals.c parser.c tree.c xmlIO.c xmlmemory.c include/libxml/catalog.h include/libxml/hash.h include/libxml/list.h include/libxml/parser.h include/libxml/tree.h include/libxml/parserInternals.h include/libxml/valid.hi include/libxml/xmlIO.h include/libxml/xmlerror.hi include/libxml/xmlmemory.h include/libxml/xmlversion.h.ini include/libxml/xpath.h include/libxml/xpathInternals.h: Cleaned up the doc comments a lot in the process, the interface coverage is now 100% Daniel
* one more doc patch from Charlie Bozeman. DanielDaniel Veillard2002-01-011-6/+6
| | | | | * xmlmemory.c: one more doc patch from Charlie Bozeman. Daniel
* some cleanups when chasing unappropriate stdout output. DanielDaniel Veillard2001-11-221-1/+2
| | | | | | * debugXML.c tree.c xmlIO.c xmlmemory.c: some cleanups when chasing unappropriate stdout output. Daniel
* Applied the last patches from Gary, cleanup, activated threading all userDaniel Veillard2001-10-131-12/+1
| | | | | | | | | | | | | | | * include/libxml/SAX.h include/libxml/globals.h include/libxml/parser.h include/libxml/parserInternals.h include/libxml/tree.h include/libxml/xmlerror.h HTMLparser.c SAX.c error.c globals.c nanoftp.c nanohttp.c parser.c parserInternals.c testDocbook.c testHTML.c testSAX.c tree.c uri.c xlink.c xmlmemory.c: Applied the last patches from Gary, cleanup, activated threading all user accessible global variables are now handled in globals.[ch] Still a bit rought but make tests passes with either --with-threads defined at configure time or not. * Makefile.am example/Makefile.am: added globals.[ch] and threads linking options Daniel