Re: [xml] xmlGcMemSetup & xmlMemSetup



On Tue, Aug 07, 2007 at 12:09:05PM +0200, Marco Spinetti wrote:
Reading the docs, I don't understand the difference between xmlMemSetup 
and xmlGcMemSetup.
I need to overwrite libxml2 memory allocation and I don't understand if 
I have to use xmlGcMemSetup or xmlMemSetup.
Any hints?

  http://xmlsoft.org/html/libxml-xmlmemory.html#xmlGcMemSetup
the later has an extra function allowing a special function for
allocation of atomic area (i.e. areas which will never be grown).
In doubt use xmlMemSetup()

Other question: is xmlInitMemory(9 should be called before use 
xmlGcMemSetup or xmlMemSetup?

  no, xmlMemSetup must be the very first call to libxml2 then call
xmlInitParser(). Don't call xmlInitMemory by yourself, xmlInitParser
will do it.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
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]