From: Dmitry Stogov Date: Tue, 20 Apr 2010 11:07:05 +0000 (+0000) Subject: Added concept of interned strings. All strings constants known at compile time are... X-Git-Tag: php-5.4.0alpha1~191^2~1745 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41b6410418cb52b5fbb76f99cadab3bf2ce336a0;p=php Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. --- diff --git a/main/main.c b/main/main.c index e6b6496133..3079bd000b 100644 --- a/main/main.c +++ b/main/main.c @@ -1508,6 +1508,7 @@ void php_request_shutdown_for_exec(void *dummy) /* used to close fd's in the 3..255 range here, but it's problematic */ shutdown_memory_manager(1, 1 TSRMLS_CC); + CG(interned_strings_restore)(TSRMLS_C); } /* }}} */ @@ -1550,6 +1551,8 @@ void php_request_shutdown_for_hook(void *dummy) shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC); } zend_end_try(); + CG(interned_strings_restore)(TSRMLS_C); + zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); @@ -1648,6 +1651,7 @@ void php_request_shutdown(void *dummy) zend_try { shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC); } zend_end_try(); + CG(interned_strings_restore)(TSRMLS_C); /* 12. Reset max_execution_time */ zend_try { @@ -2103,6 +2107,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod module_startup = 0; shutdown_memory_manager(1, 0 TSRMLS_CC); + CG(interned_strings_snapshot)(TSRMLS_C); /* we're done */ return SUCCESS;