Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24048 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51462 invoked by uid 1010); 9 Jun 2006 17:34:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51447 invoked from network); 9 Jun 2006 17:34:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2006 17:34:45 -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:2074] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id FF/6F-30619-531B9844 for ; Fri, 09 Jun 2006 13:34: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 4ED60B570F; Fri, 9 Jun 2006 19:34:40 +0200 (CEST) Message-ID: <167a01c68bea$90e988f0$6602a8c0@foxbox> Reply-To: "Steph Fox" To: "Ilia Alshanetsky" , "Andi Gutmans" Cc: "Dmitry Stogov" , References: <000001c68af5$50876930$6e02a8c0@thinkpad> <7B45819D-6E8D-4B9B-A02B-BC00BE6B1930@prohost.org> <7.0.1.0.2.20060608164415.06b4ae50@zend.com> <965CA50F-670E-43FB-B99E-B9ED9C18A6B2@prohost.org> Date: Fri, 9 Jun 2006 19:31:37 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=response 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: Re: [PATCH] Automatic module globals management From: steph@zend.com ("Steph Fox") My comments went something along the lines of 'well if it's going in can we please apply a fix for the problem this was supposed to fix in the first place, because it isn't an answer to that problem'. I'd still personally rather it didn't, but I'm happy so long as we get an actual fix in there rather than a temporary pain-in-the-ass bug we all have to work around for the next two years. > You're right, Steph's comments threw me off a bit there, but after > reconsidering the patch in detail I think it should be fine for 5.2, so > go ahead and commit it. > > > On 8-Jun-06, at 7:44 PM, Andi Gutmans wrote: > >> Why so? It doesn't affect any compatibility. >> >> 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 >>> >>> >>> >> >> > > Ilia Alshanetsky > > > >