Re: [PATCH] Automatic module globals management

From: Date: Thu, 08 Jun 2006 15:50:13 +0000
Subject: Re: [PATCH] Automatic module globals management
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-23990@lists.php.net to get a copy of this message
The attached patch (for PHP_5_2) implements automatic management of module globals. The problem that module globals must be unregistered before extension unloading, because "globls_dtor" function is unloaded together with extension and cannot be called. Dmitry-
I like the concept especially as it makes this part of the lifecycle-loop consistent with the RINIT/SHUTDOWN MINIT/SHUTDOWN design.... Having said that I like it, here's what I'd change: *) Nomenclature: I'd like to see MGCTOR/MGDTOR (and their proto wrappers) named more consistently with [RM]INIT/SHUTDOWN. e.g. GINIT/GSHUTDOWN or TINIT/TSHUTDOWN *) There are some WS problems in your patch to posix.c
I really don't like this going into 5_2 branch, and the more I think about it the less sure I am about it going into HEAD either. It would mean renaming all the ctor/dtor functions to the new globals, which is going to take an awful lot of #ifdef'ing in PECL extensions if they're going to retain compatibility across all the current versions of PHP. Steph-
I think you're missing the fact that Dmitry's patch only *enables* an extension to register CTOR/DTORs in the module entry struct. Existing modules can continue to use the manual calls in MINIT/MSHUTDOWN without breaking. -Sara

« previous php.internals (#23990) next »