Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24040 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74773 invoked by uid 1010); 9 Jun 2006 14:48:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74758 invoked from network); 9 Jun 2006 14:48:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2006 14:48:49 -0000 X-PHP-List-Original-Sender: stas@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:2163] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 76/D6-30619-05A89844 for ; Fri, 09 Jun 2006 10:48:49 -0400 Received: (qmail 9292 invoked from network); 9 Jun 2006 14:48:16 -0000 Received: from internal.zend.office (HELO mail.zend.com) (10.1.1.1) by internal.zend.office with SMTP; 9 Jun 2006 14:48:16 -0000 Date: Fri, 9 Jun 2006 17:48:16 +0300 (IDT) X-X-Sender: frodo@mail.zend.com To: Steph Fox cc: internals@lists.php.net In-Reply-To: <145901c68bad$cdd4b470$6602a8c0@foxbox> Message-ID: 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> <145901c68bad$cdd4b470$6602a8c0@foxbox> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Re: [PATCH] Automatic module globals management From: stas@zend.com (Stanislav Malyshev) SF>>The number of the final TSRM resource id that was loaded will be the SF>>size of the table they're stored in, plus one (to keep life simple). SF>>So we pick up that figure and call it 'table_size'. Then we subtract SF>>the number of modules registered in the dl_module_count. I'm not sure why is this conclusion. Do you suppose only modules allocate IDs and each of them allocates exactly one? What about Zend extensions that also allocate IDs but do not have modules? What about modules not needing globals? And what about dl()ed modules? Unless I am missing some cruicial bits, this assumption seems to me very dangerous one. SF>>Since dynamically loaded modules are the last ones to load, they're the Are you sure they are? You can load an extension on another extension startup, for example. Or on module startup. Or on any other stage of startup procedure, for that matter, starting with module startup. You seem to be relying on very precise order of events for this to work, which is not guaranteed to happen. SF>>care about dl'd modules at this point. Nothing else actually needs its SF>>resource freeing before tsrm_shutdown() (which cleans up everything that Zend extensions do too. SF>>list. But freeing a module's resources slightly early during shutdown SF>>doesn't do it any harm anyway - and the big thing here's to guarantee the I don't like it at all. Really. If the code does not do what it was intended to do, it's no excuse to say "well, nothing really bad happened" - maybe not now, but what will happen in a year when another dozen of extensions arrives? If the code doesn't do exactly the clearly defined things it is supposed to do - we are literally inviting trouble for ourselves later on the way. I thin such code is way too dangerous. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115