summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index d08b77a520..9f537fda10 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -181,6 +181,10 @@ void init_executor(void) /* {{{ */
EG(each_deprecation_thrown) = 0;
+ EG(persisent_constants_count) = EG(zend_constants)->nNumUsed;
+ EG(persistent_functions_count) = EG(function_table)->nNumUsed;
+ EG(persistent_classes_count) = EG(class_table)->nNumUsed;
+
EG(active) = 1;
}
/* }}} */
@@ -279,25 +283,9 @@ void shutdown_executor(void) /* {{{ */
* Zend Memory Manager frees memory by its own. We don't have to free
* each allocated block separately.
*/
- ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
- zend_constant *c = Z_PTR_P(zv);
- if (c->flags & CONST_PERSISTENT) {
- break;
- }
- } ZEND_HASH_FOREACH_END_DEL();
- ZEND_HASH_REVERSE_FOREACH_VAL(EG(function_table), zv) {
- zend_function *func = Z_PTR_P(zv);
- if (func->type == ZEND_INTERNAL_FUNCTION) {
- break;
- }
- } ZEND_HASH_FOREACH_END_DEL();
- ZEND_HASH_REVERSE_FOREACH_VAL(EG(class_table), zv) {
- zend_class_entry *ce = Z_PTR_P(zv);
- if (ce->type == ZEND_INTERNAL_CLASS) {
- break;
- }
- } ZEND_HASH_FOREACH_END_DEL();
-
+ zend_hash_discard(EG(zend_constants), EG(persisent_constants_count));
+ zend_hash_discard(EG(function_table), EG(persistent_functions_count));
+ zend_hash_discard(EG(class_table), EG(persistent_classes_count));
zend_cleanup_internal_classes();
} else {
zend_hash_graceful_reverse_destroy(&EG(symbol_table));