[xml] Re: Réf. : Re: [xml] Memory leaks in libxml 1.7.2

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Nov 24 1999 - 08:35:54 EST


On Wed, Nov 24, 1999 at 02:12:24PM +0100, Gilles FILIPPINI wrote:
>
> Well, I didn't look at the code (so please, forgive me if I'm wrong)

  Well, please look at the code before commenting on it :-\

> but there must be a
> way of doing this initialization via a static data structure (since its size is known at the
> compilation step)

  It seems I will have to go through a lenghty justification for
having malloc'ed 240 bytes :-(, oh well here it is:
  - XML specification allows the XML producer to use nearly whatever
    encoding it want's as long as the identification string is
    indicated in the document declaration section.
  - XML spec force the parsers to support at least UTF-8 and UTF-16
  - XML spec suggests the parser to basically have as much of those
    registered.
So as a design principle I did set-up an API for registering
new encoding supports, so that applications can register whaterver
encoding is needed for their specific use.

And in order to keep a clean design, the basic encodings are registered
using this API when the encoding code is used for the first time
(this among other things allows to override the default one by registering
yours before calling libxml). This is the Right Way (TM) to do it.

So I will keep this dynamic, and I will provide a function to cleanup
the encoding datastructures registered.

> so that the space allocated for it would be released as soon as
> the program exit and without any explicit call.

 Could you please indicate the operating system you're using which
doesn't deallocate the malloc'ed memory when the program exits. Except
a very few (and crude) OSes for embedded systems, all OSes I know do.

Daniel

-- 
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.
----
Message from the list xml@rufus.w3.org
Archived at : http://rufus.w3.org/veillard/XML/messages
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rufus.w3.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:52 EDT