summaryrefslogtreecommitdiff
path: root/main/streams/streams.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-03-04 10:39:13 +0100
committerAnatol Belski <ab@php.net>2017-03-04 10:39:13 +0100
commitc6982995504b6e21e8a5ade29cfb16a55196dc43 (patch)
treea196886e83d43fa9ece21e127edde10e3ab57c3e /main/streams/streams.c
parenta07272e5b63b404ff7070637137e81634a886bd8 (diff)
downloadphp-git-c6982995504b6e21e8a5ade29cfb16a55196dc43.tar.gz
Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch implements two types of interned strings - interning per process, strings are not freed till process end - interning per request, strings are freed at request end There is no runtime interning. With Opcache, all the permanent iterned strings are copied into SHM on startup, additional copying into SHM might happen on demand.
Diffstat (limited to 'main/streams/streams.c')
-rw-r--r--main/streams/streams.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index ed4b257848..4f9fabe434 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1706,7 +1706,7 @@ PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrap
return FAILURE;
}
- return zend_hash_str_add_ptr(&url_stream_wrappers_hash, protocol, protocol_len, wrapper) ? SUCCESS : FAILURE;
+ return zend_hash_add_ptr(&url_stream_wrappers_hash, zend_string_init_interned(protocol, protocol_len, 1), wrapper) ? SUCCESS : FAILURE;
}
PHPAPI int php_unregister_url_stream_wrapper(const char *protocol)