Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MFZE1

  • Loading branch information...
commit aecd5b89ee4e766be4dfb1cf07369a8bc39efd83 1 parent c767809
@zsuraski zsuraski authored
View
10 Zend/zend_constants.c
@@ -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);
+ }
}
View
18 Zend/zend_execute_API.c
@@ -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)
{
View
1  Zend/zend_globals.h
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.