Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24044 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13185 invoked by uid 1010); 9 Jun 2006 16:03:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13155 invoked from network); 9 Jun 2006 16:03:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2006 16:03:25 -0000 X-PHP-List-Original-Sender: iliaal@gmail.com X-Host-Fingerprint: 64.233.184.225 wr-out-0506.google.com Linux 2.4/2.6 Received: from ([64.233.184.225:15215] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F2/FA-30619-CCB99844 for ; Fri, 09 Jun 2006 12:03:24 -0400 Received: by wr-out-0506.google.com with SMTP id 67so937009wri for ; Fri, 09 Jun 2006 09:03:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=DlNqhBcZy+SO6w3L8h5hzuTy0Qvkpo/qIk7O1Xsdc4Ar1gH3bk5E7Ef8Vb3M/MCGImrOu3lnBD6v7MsRAbFQsWqswUSF/l+f+aeWRePVJdAqDs240ajXL29sobjmDRpAp+TkChVxet4QV428Qsac6IPxXh+5ia11UzESaBU0AAw= Received: by 10.64.91.10 with SMTP id o10mr2879839qbb; Fri, 09 Jun 2006 09:03:20 -0700 (PDT) Received: from ?192.168.1.16? ( [72.59.8.142]) by mx.gmail.com with ESMTP id 1sm1371300qbh.2006.06.09.09.03.18; Fri, 09 Jun 2006 09:03:20 -0700 (PDT) In-Reply-To: <7.0.1.0.2.20060608164415.06b4ae50@zend.com> References: <000001c68af5$50876930$6e02a8c0@thinkpad> <7B45819D-6E8D-4B9B-A02B-BC00BE6B1930@prohost.org> <7.0.1.0.2.20060608164415.06b4ae50@zend.com> Mime-Version: 1.0 (Apple Message framework v750) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <965CA50F-670E-43FB-B99E-B9ED9C18A6B2@prohost.org> Cc: Dmitry Stogov , , "Steph" Content-Transfer-Encoding: 7bit Date: Fri, 9 Jun 2006 12:03:14 -0400 To: Andi Gutmans X-Mailer: Apple Mail (2.750) Sender: Ilia Alshanetsky Subject: Re: [PATCH] Automatic module globals management From: ilia@prohost.org (Ilia Alshanetsky) 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