]> granicus.if.org Git - php/commitdiff
Delay hash table allocation
authorDmitry Stogov <dmitry@zend.com>
Thu, 24 Jan 2019 13:01:04 +0000 (16:01 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 24 Jan 2019 13:01:04 +0000 (16:01 +0300)
Zend/zend_string.c

index b81d5f1a73db513b6e5e394c12eb786d5c38f5e7..538d464bb4407f8d7ad07520986fb8edb98621e4 100644 (file)
@@ -67,10 +67,12 @@ 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)