From: Dmitry Stogov Date: Fri, 17 Mar 2006 08:34:16 +0000 (+0000) Subject: Optimization of module unloading (temporary modules can be only in the end) X-Git-Tag: php-5.1.3RC2~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c31c984365dcd9147b98d0f7e7415c6504e5144c;p=php Optimization of module unloading (temporary modules can be only in the end) --- diff --git a/Zend/zend.c b/Zend/zend.c index fe009ffd7c..bab26af0d6 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -877,7 +877,7 @@ static int exec_done_cb(zend_module_entry *module TSRMLS_DC) void zend_post_deactivate_modules(TSRMLS_D) { zend_hash_apply(&module_registry, (apply_func_t) exec_done_cb TSRMLS_CC); - zend_hash_apply(&module_registry, (apply_func_t) module_registry_unload_temp TSRMLS_CC); + zend_hash_reverse_apply(&module_registry, (apply_func_t) module_registry_unload_temp TSRMLS_CC); } diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b6c034a668..106f493440 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1855,11 +1855,7 @@ int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC) { - switch (module->type) { - case MODULE_TEMPORARY: - return 1; - } - return 0; + return (module->type == MODULE_TEMPORARY) ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_STOP; }