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?
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.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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