In message <[EMAIL PROTECTED]>
Charlie Savage <[EMAIL PROTECTED]> wrote:
> > The problem is that some nodes are allocated by libxml by parsing
> > documents, processing xsl, etc, and some directly by ruby. I think the
> > hybrid approach is necessary in order to get the speed benefits of using
> > libxml, and I think a hybrid approach to freeing is therefore necessary.
> > It does seem to demand a bit more smarts though, from the memory freeing
> > mechanisms.
>
> Ah - interesting. A hybrid approach is extremely difficult because it
> means you have to keep track of the ruby to libxml object mapping. For
> example, say you have some ruby code that create a libxml node. That
> ruby object would then implement a free method that frees the libxml
> node. But let's say you end up with a 2nd ruby object pointing to the
> same libxml object (which is really easy to do) - now you have a problem.
Keeping track of the mapping is exactly what I wound up doing in
my patch - just for attributes and elements I think although the
problem probably exists with other objects as well and could do
with extending.
Tom
--
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/
_______________________________________________
libxml-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/libxml-devel