]> granicus.if.org Git - php/commitdiff
Use interned strings for hash algorithm names (not copyied into SHM)
authorDmitry Stogov <dmitry@zend.com>
Tue, 31 Oct 2017 23:40:39 +0000 (02:40 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 31 Oct 2017 23:40:39 +0000 (02:40 +0300)
ext/hash/hash.c

index 5932ad9c6a2f29a56189eadb2d6199a2cd01f8fe..9819a6e7ed98d5a1008a0ae79bc7f7180af3f5a5 100644 (file)
@@ -98,7 +98,7 @@ PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *o
 {
        size_t algo_len = strlen(algo);
        char *lower = zend_str_tolower_dup(algo, algo_len);
-       zend_hash_str_add_ptr(&php_hash_hashtable, lower, algo_len, (void *) ops);
+       zend_hash_add_ptr(&php_hash_hashtable, zend_string_init_interned(lower, algo_len, 1), (void *) ops);
        efree(lower);
 }
 /* }}} */