Re: [xml] tracking libxml's internal node creation / destruction?



On Mon, Dec 30, 2002 at 11:09:41AM +0100, Luca Padovani wrote:
Hi Lukas,

On Mon, 2002-12-30 at 10:04, Lukas Schroeder wrote:
how do other libxml2 language bindings handle these cases?

in gdome2 (DOM C binding for libxml2) we keep track of node allocation

  and in the Python bindings, the global policy is that the python
node wrappers are deallocated using the the Python refcounting while
the native C object have to be explicitely deallocated by freeing the
containing document at the end of the processing (i.e. no reference counting
of C objects it's too heavy and not worth it).

at the libxml2 level and at the gdome2 level) but there aren't many
choices with the current API of libxml2. We also proposed to add similar
callback functions, but if I remember correctly the position against
them was to preserve API compatibility.

Is libxml3 sort of coming soon? 

  libxml3 may never show up. So I applied Lukas Schroeder patch (which
except for a single reject applied cleanly), but there is probably a 
number of places in the code where objects may be allocated or deallocated
which won't generate the expected callback. I don't have the time right
now to track those holes. Since both of you are interested in this issue
I welcome further patches adding the callbacks in the places missing it.
The danger is obviously that by relying on those callbacks, if some are missing
the associated wrappers may fail to function correctly or insidiously leak
memory, I think to make this really usable this will need quite a bit of
testing, the coverage can probably be automated in a large part,

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]