]> granicus.if.org Git - php/commitdiff
MFZE1
authorZeev Suraski <zeev@php.net>
Tue, 23 Oct 2001 01:23:36 +0000 (01:23 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 23 Oct 2001 01:23:36 +0000 (01:23 +0000)
Zend/zend_constants.c
Zend/zend_execute_API.c
Zend/zend_globals.h

index b4deb62f825e3058dfd3f0faffb0a8b4b6f74c1d..8fb2b8c3db8e4a93b4fd0bbe84aaab27bcb68e70 100644 (file)
@@ -58,9 +58,9 @@ void zend_copy_constants(HashTable *target, HashTable *source)
 static int clean_non_persistent_constant(zend_constant *c TSRMLS_DC)
 {
        if (c->flags & CONST_PERSISTENT) {
-               return ZEND_HASH_APPLY_STOP;
+               return EG(full_tables_cleanup) ? 0 : ZEND_HASH_APPLY_STOP;
        } else {
-               return ZEND_HASH_APPLY_REMOVE;
+               return EG(full_tables_cleanup) ? 1 : ZEND_HASH_APPLY_REMOVE;
        }
 }
 
@@ -160,7 +160,11 @@ int zend_shutdown_constants(TSRMLS_D)
 
 void clean_non_persistent_constants(TSRMLS_D)
 {
-       zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC);
+       if (EG(full_tables_cleanup)) {
+               zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC);
+       } else {
+               zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC);
+       }
 }
 
 
index 2c541d9227b310a5a3212865b340dcb0b7f24273..55fd2329931bbafd3b5b37cc03fc15c6621c2fcb 100644 (file)
@@ -93,9 +93,9 @@ static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC)
 static int is_not_internal_function(zend_function *function TSRMLS_DC)
 {
        if (function->type == ZEND_INTERNAL_FUNCTION) {
-               return ZEND_HASH_APPLY_STOP;
+               return EG(full_tables_cleanup) ? 0 : ZEND_HASH_APPLY_STOP;
        } else {
-               return ZEND_HASH_APPLY_REMOVE;
+               return EG(full_tables_cleanup) ? 1 : ZEND_HASH_APPLY_REMOVE;
        }
 }
 
@@ -103,9 +103,9 @@ static int is_not_internal_function(zend_function *function TSRMLS_DC)
 static int is_not_internal_class(zend_class_entry *ce TSRMLS_DC)
 {
        if (ce->type == ZEND_INTERNAL_CLASS) {
-               return ZEND_HASH_APPLY_STOP;
+               return EG(full_tables_cleanup) ? 0 : ZEND_HASH_APPLY_STOP;
        } else {
-               return ZEND_HASH_APPLY_REMOVE;
+               return EG(full_tables_cleanup) ? 1 : ZEND_HASH_APPLY_REMOVE;
        }
 }
 
@@ -183,8 +183,13 @@ void shutdown_executor(TSRMLS_D)
                zend_ptr_stack_destroy(&EG(argument_stack));
 
                /* Destroy all op arrays */
-               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);
+               if (EG(full_tables_cleanup) {
+                       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);
+               } else {
+                       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
@@ -666,6 +671,7 @@ ZEND_API void zend_timeout(int dummy)
 }
 
 
+       EG(full_tables_cleanup) = 0;
 #ifdef ZEND_WIN32
 static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
 {
index 31ad79bd65b7c1bc7535b00fd1aac4ac07b6b6e6..67d15c314652545bd5fa5e2ffe1f17bac85e6839 100644 (file)
@@ -166,6 +166,7 @@ struct _zend_executor_globals {
 
        zend_bool in_execution;
        zend_bool bailout_set;
+       zend_bool full_tables_cleanup;
 
        /* for extended information support */
        zend_bool no_extensions;