Use interned strings for hash algorithm names (not copyied into SHM)

This commit is contained in:
Dmitry Stogov 2017-11-01 02:40:39 +03:00
parent 8897c80956
commit 0056f52f50

View 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); size_t algo_len = strlen(algo);
char *lower = zend_str_tolower_dup(algo, algo_len); 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); efree(lower);
} }
/* }}} */ /* }}} */