Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

TSRMLS_FETCH work

  • Loading branch information...
commit fcc035108f7b8d2e169c5a592227b3df84d0573e 1 parent 1f3faae
Zeev Suraski zsuraski authored

Showing 3 changed files with 14 additions and 9 deletions. Show diff stats Hide diff stats

  1. +7 1 Zend/zend.c
  2. +3 4 Zend/zend_API.c
  3. +4 4 Zend/zend_API.h
8 Zend/zend.c
@@ -329,6 +329,12 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
329 329 }
330 330
331 331
  332 +static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
  333 +{
  334 + shutdown_memory_manager(0, 1);
  335 +}
  336 +
  337 +
332 338 #ifdef __FreeBSD__
333 339 /* FreeBSD floating point precision fix */
334 340 #include <floatingpoint.h>
@@ -350,7 +356,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
350 356 zend_executor_globals *executor_globals;
351 357 void ***tsrm_ls;
352 358
353   - ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, NULL);
  359 + ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
354 360 #else
355 361 alloc_globals_ctor(&alloc_globals TSRMLS_CC);
356 362 #endif
7 Zend/zend_API.c
@@ -566,10 +566,9 @@ ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC)
566 566 }
567 567
568 568
569   -ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC)
  569 +ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC)
570 570 {
571 571 zval *tmp;
572   - TSRMLS_FETCH();
573 572
574 573 if (!class_type->constants_updated) {
575 574 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
585 584 }
586 585
587 586
588   -ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC)
  587 +ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC)
589 588 {
590   - return _object_init_ex(arg, &zend_standard_class_def ZEND_FILE_LINE_CC);
  589 + return _object_init_ex(arg, &zend_standard_class_def ZEND_FILE_LINE_CC TSRMLS_CC);
591 590 }
592 591
593 592
8 Zend/zend_API.h
@@ -151,11 +151,11 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
151 151 ZEND_API int zend_startup_module(zend_module_entry *module);
152 152
153 153 #define array_init(arg) _array_init((arg) ZEND_FILE_LINE_CC)
154   -#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
155   -#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
  154 +#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC TSRMLS_CC)
  155 +#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC TSRMLS_CC)
156 156 ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC);
157   -ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
158   -ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
  157 +ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC);
  158 +ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
159 159
160 160 /* no longer supported */
161 161 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.