Tom Bagby wrote:
I had intended to clean this up and post it as a real patch, but never had the time.
I believe the ivar stuff does work fine, its just something that I changed
while I was digging around for what the problem was and I never backed it out. Ref-counting was the only solution I could come up with. The issue is that the xpath
object *has* to be freed before the document, not the other way around.
Since the GC doesn't free them in any particular order, that seemed the best way to
 make sure that the document did not get freed first.

Right, exactly. I had a scheme in mind where each time an xpath object was created, it would register itself with the document. Then when the document is freed, it would free the xpath objects first. You'd then have to add in a check for dangling references to the xpath objects though. Your way seems a bit cleaner, although I'd probably add an api to the document object (maybe something like incrementXPathRef, decrementXPathRef) just to keep it a bit more contained.


We make extremely heavy use of libxml in production with this patch and it 
completely got
rid of all of our intermittent crashing in stress testing, so I feel pretty good
 about stability with this change.

That sounds great. Do you have a bit of time to cleanup it up and submit it? I'd love to solve this problem once and for all.

Charlie

--
Charlie Savage
http://cfis.savagexi.com

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to