summaryrefslogtreecommitdiff
path: root/Zend/zend_string.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-02 23:29:21 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-02 23:29:21 +0300
commitf2b91b31e4625f953e57ed68ce992a72bc6e7846 (patch)
treedaa8d29d23da5d9addf220313c64e5da565c36b6 /Zend/zend_string.c
parent3f6693c5e01f42e51bef8c8664abacfaccfdf3fa (diff)
downloadphp-git-f2b91b31e4625f953e57ed68ce992a72bc6e7846.tar.gz
Switch back from "request" interned strings storage to "permanent" in MSHUTDOWN
Diffstat (limited to 'Zend/zend_string.c')
-rw-r--r--Zend/zend_string.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a5ecd411ba..2fcaefcbdc 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -38,6 +38,7 @@ 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];
@@ -254,18 +255,27 @@ 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_handler(zend_string_copy_storage_func_t 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 = handler;
+ interned_string_copy_storage = copy_handler;
+ interned_string_restore_storage = restore_handler;
}
-ZEND_API void zend_interned_strings_switch_storage(void)
+ZEND_API void zend_interned_strings_switch_storage(zend_bool request)
{
- if (interned_string_copy_storage) {
- interned_string_copy_storage();
+ 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();
+ }
}
- zend_new_interned_string = interned_string_request_handler;
- zend_string_init_interned = interned_string_init_request_handler;
}
/*