Re: [xml] xmlCleanupParser() question / patch
- From: Daniel Veillard <veillard redhat com>
- To: James Hart <beeblebrox42 gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] xmlCleanupParser() question / patch
- Date: Tue, 19 Jan 2010 16:46:06 +0100
On Tue, Jan 19, 2010 at 07:54:20AM -0700, James Hart wrote:
Do you suspect that there are more broken implementation vs.
implementations correctly using xmlCleanupParser? The proposed change
The point is about "brokeness", missing xmlCleanupParser results just
in a minimal leak for remaining lifetime of the program, and honnestly
except for getting a clean "valgrind leakcheck" (or equivalent tool)
output people won't find a good use of it, but as time and experience
has proved an awful lot of people tend to use xmlCleanupParser() in the
wrong place, and this get totally insane when it get embedded in shared
library where there is no way to use it safely in general.
would break correctly implemented systems, but still compile and be
hard to detect. Shouldn't correctly implemented systems be favored
over the broken ones?
Well as said in previous reply the cost is different for the 2 cases.
I agree it's not ideal !
For example, in our system we have specifically used a RAII design
pattern so multiple libraries can access libxml and the initialization
and cleanup of the library is handled by a reference counting systems
because we have no control of the order these libraries will be loaded
in our system. The goal we have is to completely unload and cleanup
the library when there are no libraries requiring it's use anymore and
to reload it if a library requires it again. If the API changes
functionality, yet is link compatible it is very possible the change
you proposed will go unnoticed for some time.
suffice one of the shared library used by your system start using
libxml2 under the hood, say to parse a configuration file, suddenly
everything breaks. The problem is that this is safe to call only in a
fully controlled environment, for example in xmllint .
If you rename the function I would prefer you to remove the old
signature completely so current working implementations will know they
need to change. Current broken implementations would need to change
That is impossible that would break the ABI, and kill most of the
userbase immediately :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]