Re: Re: [PATCH] Automatic module globals management

From: Date: Sun, 11 Jun 2006 07:51:37 +0000
Subject: Re: Re: [PATCH] Automatic module globals management
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-24087@lists.php.net to get a copy of this message
SF>>Erm, Stas, it's not because it's impossible - it's because that SF>>module_shutdown_func happens to be the module's MSHUTDOWN. The contents of SF>>MSHUTDOWN generally look something like: SF>> SF>>#ifdef ZTS SF>>ts_free_id(pcre_globals_id); SF>>#else SF>>php_pcre_shutdown_globals(&pcre_globals TSRMLS_CC); SF>>#endif SF>> SF>>UNREGISTER_INI_ENTRIES(); SF>> SF>>return SUCCESS; That's quite an assumption. What if it looks like: if(MODULE_G(flag)) { do_complicated_shutdown(MODULE_G(data)); } before your code, and you have already freed the MODULE_G's id? SF>>I'm not changing a darn thing in the order of the calls there, and that's SF>>*exactly* why I don't get your point. You are changing the order of ts_free_id's however - once you assumption of "one alloc exactly per module" is wrong, you can have free_id before dtor is called. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

« previous php.internals (#24087) next »