"Rob Richards" <[EMAIL PROTECTED]> wrote:

> From: Moriyoshi Koizumi
> 
> > Indeed. But as long as libxml allocators are designed to be initialised
> > only in the xml extension, the order could be a problem in which those
> > extensions are initialised on startup. Maybe I can make clones of the
> > xmlMemSetup() code and paste them to the PHP_MINIT_FUNCTION() of every
> > extension which uses libxml, but it hardly looks like a better solution.
> > I'd asked you for more a practical option :)
> 
> We had originally looked at implementing that xml_parser_inited stuff, but
> the way it was implemented was basically duplicating the same initialization
> code everywhere.

I wasn't aware of being the third person here..

> What would be nice would to have a centralized function (it would have to
> live outside all the libxml based extensions that every extension could call
> on MINIT. It would be re-entrant safe to avoid corruption of globals. Then
> the extension could just call the function during its MINIT (as this would
> also make it extremely easy to change initialization routines to correspond
> with any changes in libxml or add any initialization that would need to take
> place).
> 
> This probably does have some draw backs, but it would be ideal.

It looks like we(?) need a functionality in TSRM similar to pthread_once(), 
with which we could make sure that the initialisation routine with 
an unique integer ID is called only once in the lifetime of the process.

As for Win32, I think it's possible to emulate it with TLS stuff though 
the API doesn't provide a specific function dedicated to that 
functionality.

Moriyoshi


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to