Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24017 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9818 invoked by uid 1010); 9 Jun 2006 03:47:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 9803 invoked from network); 9 Jun 2006 03:47:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2006 03:47:46 -0000 X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:10828] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id EA/BA-30619-06FE8844 for ; Thu, 08 Jun 2006 23:47:45 -0400 Received: from foxbox (IGLD-84-229-192-204.inter.net.il [84.229.192.204]) by gw2.emini.dk (Postfix) with ESMTP id 8F28EB5878; Fri, 9 Jun 2006 05:47:39 +0200 (CEST) Message-ID: <139a01c68b76$f97c6a00$6602a8c0@foxbox> Reply-To: "Steph Fox" To: "Ilia Alshanetsky" , "Dmitry Stogov" , "Andi Gutmans" Cc: References: <000001c68af5$50876930$6e02a8c0@thinkpad><7B45819D-6E8D-4B9B-A02B-BC00BE6B1930@prohost.org> <7.0.1.0.2.20060608164415.06b4ae50@zend.com> <133f01c68b73$fb1a1bd0$6602a8c0@foxbox> Date: Fri, 9 Jun 2006 05:44:11 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: [PATCH] Keeping module dtors kosher for PHP 5* [WAS: [PATCH] Automatic module globals management] From: steph@zend.com ("Steph Fox") I've done it again - this was an invisible patch :) OK, relabelling the email. Nothing new to see here, move along... ----- Original Message ----- From: "Steph Fox" To: "Ilia Alshanetsky" ; "Dmitry Stogov" ; "Andi Gutmans" Cc: Sent: Friday, June 09, 2006 5:22 AM Subject: Re: [PHP-DEV] Re: [PATCH] Automatic module globals management > Andi, > >> Why so? It doesn't affect any compatibility. > > Yes it does, and more particularly it prevents any fix for the win32/ZTS > issue until people upgrade to the new module API. If everyone has to add > an > extra #ifdef into MSHUTDOWN to get around the new situation, but then has > to > take it away again 2 versions later... bleh... it's all wrong :) > > Sara said earlier on IRC that it would be good to make the win32/ZTS thing > a > separate issue. I think so too. > > Attached are patches for fixing the win32/ZTS thing only when needed - > this > will _only_ work if you apply Dmitry's patch to 5_2 as well. The idea > being > that this way everybody's covered. > > It's similar for 5_1, except that it doesn't need the check for Dmitry's > changes. > > I don't think we'll need my input for HEAD. As someone said earlier, > people > will make changes for PHP 6.0 that they might not be ready or willing to > make for PHP 5.*. A good suggestion Sara came out with for PECL (this was > also on IRC) was to have some version check and offer up different #ext.c > files accordingly. At present we don't have that option, but we will if > the > module API number is bumped following Dmitry's changes. > > I still don't like it - but I'm quite good at smelling the way the > goldfish > are swimming :-\ > > - Steph > >> >> At 02:31 PM 6/8/2006, Ilia Alshanetsky wrote: >>>The patch is good, but I think this change maybe a bit too extreme >>>for PHP 5.2 >>> >>> >>>On 8-Jun-06, at 8:15 AM, Dmitry Stogov wrote: >>> >>>>Hi, >>>> >>>>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. >>>> >>>>To solve this problem extension writers now use the following pattern: >>>> >>>> PHP_MSHUTDOWN_FUNCTION(mod_name) >>>> { >>>>-#ifdef ZTS >>>>- ts_free_id(mod_name_globals_id); >>>>-#else >>>>- mod_name_globals_dtor(&mod_name_globals TSRMLS_CC); >>>>-#endif >>>> >>>>With my patch, extension writers should just extend module >>>>descriptor with >>>>globals descriptor and ctor/dtor callbacks. >>>> >>>> PHP_RSHUTDOWN(mod_name), >>>> PHP_MINFO(mod_name), >>>> NO_VERSION_YET, >>>>- STANDARD_MODULE_PROPERTIES >>>>+ NULL, >>>>+ ZEND_MG(mod_name), >>>>+ ZEND_MGCTOR(mod_name), >>>>+ ZEND_MGCTOR(mod_name), >>>>+ STANDARD_MODULE_PROPERTIES_EX2 >>>> }; >>>> >>>>Old extensions are source compatible and may work without >>>>modification. >>>>The patch modifies only several extensions, but will modify others >>>>too. >>>> >>>>I like commit the patch into HEAD and PHP_5_2. >>>>Any objections, additional ideas? >>>> >>>>Thanks. Dmitry. >>>> >>> >>>Ilia Alshanetsky >>> >>> >>> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> __________ NOD32 1.1380 (20060125) Information __________ >> >> This message was checked by NOD32 antivirus system. >> http://www.eset.com >> >> > > > __________ NOD32 1.1380 (20060125) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > > -------------------------------------------------------------------------------- > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > __________ NOD32 1.1380 (20060125) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > >