Re: [xml] Can I allocate the memory for a xml-tree by myself?



On Fri, Jan 14, 2005 at 03:33:15PM +0100, Ronny Seemann wrote:
While using the parser module from libxml2 for parsing a XML document, it 
allocates the memory that is required itself. 
Is there a possibility in libxml2 to allocate this memory by myself. I would 
like to allocate my own memory, in order to give over that chunk to e.g. 
xmlParseFile(char *), where the xml-tree can be created.

  You can override libxml2 memory routines.
    http://xmlsoft.org/xmlmem.html#setting
    http://xmlsoft.org/html/libxml-xmlmemory.html#xmlMemSetup
of course if you don't completely understand what it does, what
are the potential impacts of doing so, it will crash, put your
CPU on fire or even worse and you're absolutely on your own to
debug the thing. But you can do it. If you're not experienced with
libxml2 I suggest to avoid it as much as possible.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]