diff options
Diffstat (limited to 'Zend/zend_string.c')
-rw-r--r-- | Zend/zend_string.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/Zend/zend_string.c b/Zend/zend_string.c index 61e5f51b7f..75e7e6249f 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -39,8 +39,6 @@ static HashTable interned_strings_permanent; static zend_new_interned_string_func_t interned_string_request_handler = zend_new_interned_string_request; static zend_string_init_interned_func_t interned_string_init_request_handler = zend_string_init_interned_request; -static zend_string_copy_storage_func_t interned_string_copy_storage = NULL; -static zend_string_copy_storage_func_t interned_string_restore_storage = NULL; ZEND_API zend_string *zend_empty_string = NULL; ZEND_API zend_string *zend_one_char_string[256]; @@ -69,22 +67,22 @@ ZEND_KNOWN_STRINGS(_ZEND_STR_DSC) NULL }; -static void zend_init_interned_strings_ht(HashTable *interned_strings, int permanent) +static zend_always_inline void zend_init_interned_strings_ht(HashTable *interned_strings, int permanent) { zend_hash_init(interned_strings, 1024, NULL, _str_dtor, permanent); - zend_hash_real_init_mixed(interned_strings); + if (permanent) { + zend_hash_real_init_mixed(interned_strings); + } } ZEND_API void zend_interned_strings_init(void) { char s[2]; - int i; + unsigned int i; zend_string *str; interned_string_request_handler = zend_new_interned_string_request; interned_string_init_request_handler = zend_string_init_interned_request; - interned_string_copy_storage = NULL; - interned_string_restore_storage = NULL; zend_empty_string = NULL; zend_known_strings = NULL; @@ -315,26 +313,14 @@ ZEND_API void zend_interned_strings_set_request_storage_handlers(zend_new_intern interned_string_init_request_handler = init_handler; } -ZEND_API void zend_interned_strings_set_permanent_storage_copy_handlers(zend_string_copy_storage_func_t copy_handler, zend_string_copy_storage_func_t restore_handler) -{ - interned_string_copy_storage = copy_handler; - interned_string_restore_storage = restore_handler; -} - ZEND_API void zend_interned_strings_switch_storage(zend_bool request) { if (request) { - if (interned_string_copy_storage) { - interned_string_copy_storage(); - } zend_new_interned_string = interned_string_request_handler; zend_string_init_interned = interned_string_init_request_handler; } else { zend_new_interned_string = zend_new_interned_string_permanent; zend_string_init_interned = zend_string_init_interned_permanent; - if (interned_string_restore_storage) { - interned_string_restore_storage(); - } } } @@ -475,13 +461,3 @@ ZEND_API zend_bool ZEND_FASTCALL I_WRAP_SONAME_FNNAME_ZU(NONE,zend_string_equal_ #endif #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ |