Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24011 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46092 invoked by uid 1010); 8 Jun 2006 21:31:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46076 invoked from network); 8 Jun 2006 21:31:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2006 21:31:48 -0000 X-PHP-List-Original-Sender: iliaal@gmail.com X-Host-Fingerprint: 64.233.184.230 wr-out-0506.google.com Linux 2.4/2.6 Received: from ([64.233.184.230:12767] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 82/60-00946-34798844 for ; Thu, 08 Jun 2006 17:31:47 -0400 Received: by wr-out-0506.google.com with SMTP id 67so740812wri for ; Thu, 08 Jun 2006 14:31:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:x-priority:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=F135Pj7oHDBB3BUYhmz+zzmcd/IQD2UBhmT/D9jMDNHxbHWuDmEAetPT4qQFkDMkYxR6JrizPL960YaUktkdII3OU+vT8pxjhMRw2rMiT0zE5MaqN06QaR/5rdqiL6uFyVUDeyBATLePIiLZBl7B2RQ5MBlPFeBzkbwVYXqQIwo= Received: by 10.64.24.20 with SMTP id 20mr2481859qbx; Thu, 08 Jun 2006 14:31:43 -0700 (PDT) Received: from ?192.168.1.6? ( [72.59.8.142]) by mx.gmail.com with ESMTP id f13sm423416qba.2006.06.08.14.31.43; Thu, 08 Jun 2006 14:31:43 -0700 (PDT) In-Reply-To: <000001c68af5$50876930$6e02a8c0@thinkpad> References: <000001c68af5$50876930$6e02a8c0@thinkpad> Mime-Version: 1.0 (Apple Message framework v750) X-Priority: 3 (Normal) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <7B45819D-6E8D-4B9B-A02B-BC00BE6B1930@prohost.org> Cc: , "Andi Gutmans" , "Steph" Content-Transfer-Encoding: 7bit Date: Thu, 8 Jun 2006 17:31:39 -0400 To: Dmitry Stogov X-Mailer: Apple Mail (2.750) Sender: Ilia Alshanetsky Subject: Re: [PATCH] Automatic module globals management From: ilia@prohost.org (Ilia Alshanetsky) 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