diff options
author | Zeev Suraski <zeev@php.net> | 2001-08-02 07:00:43 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-08-02 07:00:43 +0000 |
commit | c14baeece3d5fed4e20e43dce42ca04ef1f5618a (patch) | |
tree | adebdc7af8e27a31f3b93b5a2f13f3bc0bea57ec /Zend/zend_execute_API.c | |
parent | 7deb44e36d98395af07e629ad9b646e0adb8cf55 (diff) | |
download | php-git-c14baeece3d5fed4e20e43dce42ca04ef1f5618a.tar.gz |
Avoid going over huge lists of functions, classes and constants.
Special thanks to the guys from the MS lab for the profiling tools :)
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 6ee4fd9634..1c9e42a5e4 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -92,13 +92,21 @@ static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC) static int is_not_internal_function(zend_function *function TSRMLS_DC) { - return(function->type != ZEND_INTERNAL_FUNCTION); + if (function->type == ZEND_INTERNAL_FUNCTION) { + return ZEND_HASH_APPLY_STOP; + } else { + return ZEND_HASH_APPLY_REMOVE; + } } static int is_not_internal_class(zend_class_entry *ce TSRMLS_DC) { - return(ce->type != ZEND_INTERNAL_CLASS); + if (ce->type == ZEND_INTERNAL_CLASS) { + return ZEND_HASH_APPLY_STOP; + } else { + return ZEND_HASH_APPLY_REMOVE; + } } @@ -173,8 +181,8 @@ void shutdown_executor(TSRMLS_D) zend_ptr_stack_destroy(&EG(argument_stack)); /* Destroy all op arrays */ - zend_hash_apply(EG(function_table), (apply_func_t) is_not_internal_function TSRMLS_CC); - zend_hash_apply(EG(class_table), (apply_func_t) is_not_internal_class TSRMLS_CC); + zend_hash_reverse_apply(EG(function_table), (apply_func_t) is_not_internal_function TSRMLS_CC); + zend_hash_reverse_apply(EG(class_table), (apply_func_t) is_not_internal_class TSRMLS_CC); } zend_end_try(); /* The regular list must be destroyed after the main symbol table and |