mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Use interned strings for stream transports
This commit is contained in:
parent
ed5b4d5c99
commit
8897c80956
@ -695,6 +695,13 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int
|
||||
p->key = new_interned_string(p->key);
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
ht = php_stream_xport_get_hash();
|
||||
ZEND_HASH_FOREACH_BUCKET(ht, p) {
|
||||
if (p->key) {
|
||||
p->key = new_interned_string(p->key);
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
|
||||
static zend_string *accel_replace_string_by_shm_permanent(zend_string *str)
|
||||
|
@ -31,7 +31,7 @@ PHPAPI HashTable *php_stream_xport_get_hash(void)
|
||||
|
||||
PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory)
|
||||
{
|
||||
return zend_hash_str_update_ptr(&xport_hash, protocol, strlen(protocol), factory) ? SUCCESS : FAILURE;
|
||||
return zend_hash_update_ptr(&xport_hash, zend_string_init_interned(protocol, strlen(protocol), 1), factory) ? SUCCESS : FAILURE;
|
||||
}
|
||||
|
||||
PHPAPI int php_stream_xport_unregister(const char *protocol)
|
||||
|
Loading…
Reference in New Issue
Block a user