Skip to content
Browse files

TSRMLS_FETCH work

  • Loading branch information...
1 parent 1f3faae commit fcc035108f7b8d2e169c5a592227b3df84d0573e @zsuraski zsuraski committed Aug 5, 2001
Showing with 14 additions and 9 deletions.
  1. +7 −1 Zend/zend.c
  2. +3 −4 Zend/zend_API.c
  3. +4 −4 Zend/zend_API.h
View
8 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
View
7 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);
}
View
8 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));

0 comments on commit fcc0351

Please sign in to comment.
Something went wrong with that request. Please try again.