summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend.c8
-rw-r--r--Zend/zend_API.c7
-rw-r--r--Zend/zend_API.h8
3 files changed, 14 insertions, 9 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index fe24a67956..abd8b49477 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -329,6 +329,12 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
}
+static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
+{
+ shutdown_memory_manager(0, 1);
+}
+
+
#ifdef __FreeBSD__
/* FreeBSD floating point precision fix */
#include <floatingpoint.h>
@@ -350,7 +356,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_executor_globals *executor_globals;
void ***tsrm_ls;
- ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, NULL);
+ ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
#else
alloc_globals_ctor(&alloc_globals TSRMLS_CC);
#endif
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index a46c3872f0..08aaeeb528 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -566,10 +566,9 @@ ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC)
}
-ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC)
+ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC)
{
zval *tmp;
- TSRMLS_FETCH();
if (!class_type->constants_updated) {
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
@@ -585,9 +584,9 @@ ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_L
}
-ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC)
+ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC)
{
- return _object_init_ex(arg, &zend_standard_class_def ZEND_FILE_LINE_CC);
+ return _object_init_ex(arg, &zend_standard_class_def ZEND_FILE_LINE_CC TSRMLS_CC);
}
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index e8264590d3..5567d5d7a1 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -151,11 +151,11 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
ZEND_API int zend_startup_module(zend_module_entry *module);
#define array_init(arg) _array_init((arg) ZEND_FILE_LINE_CC)
-#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
-#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
+#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC TSRMLS_CC)
+#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC TSRMLS_CC)
ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC);
-ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
-ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
+ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC);
+ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
/* no longer supported */
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));