[gdome] Re: libxml memory issues

[ I Cc'ed xml and gdome lists since they are certainly interested by those issues]

 Hi Brad,

> Thanks for all your work on libxml. It has proven to be a very great
> help
> to me. Very good job. I have a few comments about places in the code
> that are a
> little unclear.
> /** xmlDocDumpMemory:
>  * Dump an XML document in memory and return the CHAR * and it's size.
>  * It's up to the caller to free the memory.
> */
> This routine returns a pointer to static memory and should not be freed.

  Well I will rather fix the library behaviour. Having a thread safe version
is still my intend and one will have to free the memory.

> However, this results of this routine
> /**
>  * xmlNodeGetContent:
>  * @cur:  the node being read
>  *
>  * Read the value of a node, this can be either the text carried
>  * directly by this node if it's a TEXT node or the aggregate string
>  * of the values carried by this node child's (TEXT and ENTITY_REF).
>  * Entity references are substitued.
>  * Returns a new CHAR * or NULL if no content is available.
>  */
> do need to be freed. Could you comment to this effect in the code?

  Yep, done.

> Also, do you plan on making a thread safe version of this library?

  Ok, I have nearly finished removing all buffer problems which were
making the parser non thread safe, I hope to commit this to gnome CVS
base this afternoon. Basically I introduced an xmlBuffer type (which should
be useful for UTF8 conversion purposes too) and rewrote the dump routines
to use those. Only two interfaces are broken and they were clearly labeled
as unstable not for public use in tree.h (xmlBufferWriteChar and
xmlBufferWriteCHAR, I will probably get rid of them for good at some point).


	    [Yes, I have moved back to France !]
Daniel Veillard w3 org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux, WWW, rpmfind,
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | rpm2html, XML,
http://www.w3.org/People/W3Cpeople.html#Veillard | badminton, and Kaffe.

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