From ed6f24b92e77881129d13a95bdd93a3b77e91153 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 26 Sep 2014 21:50:27 +0200 Subject: [PATCH] cleanup TSRMLS_FETCH in ext/opcache --- ext/opcache/ZendAccelerator.c | 9 --------- ext/opcache/shared_alloc_win32.c | 1 - ext/opcache/zend_accelerator_blacklist.c | 1 - ext/opcache/zend_accelerator_debug.c | 1 - ext/opcache/zend_accelerator_util_funcs.c | 3 --- ext/opcache/zend_shared_alloc.c | 3 --- 6 files changed, 18 deletions(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index b5c20f91e47..1bd3734718a 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1825,8 +1825,6 @@ static void zend_reset_cache_vars(TSRMLS_D) static void accel_activate(void) { - TSRMLS_FETCH(); - if (!ZCG(enabled) || !accel_startup_ok) { return; } @@ -1938,7 +1936,6 @@ static void accel_fast_zval_dtor(zval *zvalue) if (Z_REFCOUNTED_P(zvalue) && Z_DELREF_P(zvalue) == 0) { switch (Z_TYPE_P(zvalue)) { case IS_ARRAY: { - TSRMLS_FETCH(); GC_REMOVE_FROM_BUFFER(Z_ARR_P(zvalue)); if (Z_ARR_P(zvalue) != &EG(symbol_table)) { /* break possible cycles */ @@ -1949,15 +1946,11 @@ static void accel_fast_zval_dtor(zval *zvalue) break; case IS_OBJECT: { - TSRMLS_FETCH(); - OBJ_RELEASE(Z_OBJ_P(zvalue)); } break; case IS_RESOURCE: { - TSRMLS_FETCH(); - /* destroy resource */ zend_list_delete(Z_RES_P(zvalue)); } @@ -2093,7 +2086,6 @@ static void accel_deactivate(void) * In general, they're restored by persistent_compile_file(), but in case * the script is aborted abnormally, they may become messed up. */ - TSRMLS_FETCH(); if (!ZCG(enabled) || !accel_startup_ok) { return; @@ -2267,7 +2259,6 @@ static int accel_startup(zend_extension *extension) { zend_function *func; zend_ini_entry *ini_entry; - TSRMLS_FETCH(); #ifdef ZTS accel_globals_id = ts_allocate_id(&accel_globals_id, sizeof(zend_accel_globals), (ts_allocate_ctor) accel_globals_ctor, (ts_allocate_dtor) accel_globals_dtor); diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c index 37431fb18ad..cab33b5b38c 100644 --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@ -188,7 +188,6 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_ void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000, (void *) 0x31000000, (void *) 0x50000000, 0 }; #endif void **wanted_mapping_base = default_mapping_base_set; - TSRMLS_FETCH(); zend_shared_alloc_lock_win32(); /* Mapping retries: When Apache2 restarts, the parent process startup routine diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 7263ed3c93c..33aed3ce701 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -237,7 +237,6 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL; FILE *fp; int path_length, blacklist_path_length; - TSRMLS_FETCH(); if ((fp = fopen(filename, "r")) == NULL) { zend_accel_error(ACCEL_LOG_WARNING, "Cannot load blacklist file: %s\n", filename); diff --git a/ext/opcache/zend_accelerator_debug.c b/ext/opcache/zend_accelerator_debug.c index 2a386b812bc..feed711bf5c 100644 --- a/ext/opcache/zend_accelerator_debug.c +++ b/ext/opcache/zend_accelerator_debug.c @@ -34,7 +34,6 @@ void zend_accel_error(int type, const char *format, ...) time_t timestamp; char *time_string; FILE * fLog = NULL; - TSRMLS_FETCH(); if (type > ZCG(accel_directives).log_verbosity_level) { return; diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 59977717f78..bae6121f7e5 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -50,7 +50,6 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC); static void zend_accel_destroy_zend_function(zval *zv) { zend_function *function = Z_PTR_P(zv); - TSRMLS_FETCH(); if (function->type == ZEND_USER_FUNCTION) { if (function->op_array.static_variables) { @@ -350,7 +349,6 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind) uint idx; Bucket *p, *q, *r; zend_ulong nIndex; - TSRMLS_FETCH(); ht->nTableSize = source->nTableSize; ht->nTableMask = source->nTableMask; @@ -605,7 +603,6 @@ static void zend_class_copy_ctor(zend_class_entry **pce) zend_class_entry *old_ce = ce; zend_class_entry *new_ce; zend_function *new_func; - TSRMLS_FETCH(); *pce = ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry)); *ce = *old_ce; diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index 981829f5b7f..9ecb2a0eae5 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -157,8 +157,6 @@ int zend_shared_alloc_startup(size_t requested_size) const zend_shared_memory_handler_entry *he; int res = ALLOC_FAILURE; - TSRMLS_FETCH(); - /* shared_free must be valid before we call zend_shared_alloc() * - make it temporarily point to a local variable */ @@ -298,7 +296,6 @@ void *zend_shared_alloc(size_t size) { int i; unsigned int block_size = ZEND_ALIGNED_SIZE(size); - TSRMLS_FETCH(); #if 1 if (!ZCG(locked)) {