Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24014 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88579 invoked by uid 1010); 8 Jun 2006 23:44:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88563 invoked from network); 8 Jun 2006 23:44:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2006 23:44:42 -0000 X-PHP-List-Original-Sender: andi@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:27140] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id D8/B3-00946-966B8844 for ; Thu, 08 Jun 2006 19:44:42 -0400 Received: (qmail 13210 invoked from network); 8 Jun 2006 23:44:09 -0000 Received: from localhost (HELO ANDI-NOTEBOOK.zend.com) (127.0.0.1) by localhost with SMTP; 8 Jun 2006 23:44:09 -0000 Message-ID: <7.0.1.0.2.20060608164415.06b4ae50@zend.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Thu, 08 Jun 2006 16:44:33 -0700 To: Ilia Alshanetsky ,Dmitry Stogov Cc: ,"Steph" In-Reply-To: <7B45819D-6E8D-4B9B-A02B-BC00BE6B1930@prohost.org> References: <000001c68af5$50876930$6e02a8c0@thinkpad> <7B45819D-6E8D-4B9B-A02B-BC00BE6B1930@prohost.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PATCH] Automatic module globals management From: andi@zend.com (Andi Gutmans) 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 > > >