]> granicus.if.org Git - php/commitdiff
TSRMLS_FETCH work
authorZeev Suraski <zeev@php.net>
Sun, 5 Aug 2001 01:37:10 +0000 (01:37 +0000)
committerZeev Suraski <zeev@php.net>
Sun, 5 Aug 2001 01:37:10 +0000 (01:37 +0000)
Zend/zend.c
Zend/zend_API.c
Zend/zend_API.h

index fe24a67956ace06b744567d38a98754e03b304a4..abd8b49477e19003a3c9f9534c69e6fc3e4ef183 100644 (file)
@@ -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
index a46c3872f00681a776c4abbadd8b8b264331e3e2..08aaeeb528753fea9a47e2c9ef8703dfa7311ff6 100644 (file)
@@ -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);
 }
 
 
index e8264590d3d2cef3471323d434c7db10a83e3475..5567d5d7a1dcbb615792d4a31d6219ca42897bcc 100644 (file)
@@ -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));