diff options
author | Xinchen Hui <laruence@gmail.com> | 2017-11-02 10:40:45 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2017-11-02 10:40:45 +0800 |
commit | 39845250f242b7739d30b4b8a287b4a6130d8fa1 (patch) | |
tree | 3f8f69284a99f7932989f2460e8d78d1757a34cf /ext/dom/php_dom.c | |
parent | a32e567ec8b28a7ccc0ebca9d24911788aaf853c (diff) | |
parent | a7305eb539596e175bd6c3ae9a20953358c5d677 (diff) | |
download | php-git-39845250f242b7739d30b4b8a287b4a6130d8fa1.tar.gz |
Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
Made "result", "statement" and "last_message" to always use Zend MM heap. (even for persistent connections these entities don't relive request boundary)
Fixed memory leaks
Use interned strings for "magic" property of internal classes. (not copyied into SHM)
Reverted incomplete fix and too strict asserts.
Mark persistent connection related data as "thread-local".
Persistent resources are "thread-local". Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
PCRE cache is "thread-local"
Allow reference-counting on "thread-local" persistent zvals
Diffstat (limited to 'ext/dom/php_dom.c')
-rw-r--r-- | ext/dom/php_dom.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 00c8b40cb3..8fdf6aa6e0 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -302,10 +302,13 @@ static int dom_write_na(dom_object *obj, zval *newval) static void dom_register_prop_handler(HashTable *prop_handler, char *name, size_t name_len, dom_read_t read_func, dom_write_t write_func) { dom_prop_handler hnd; + zend_string *str; hnd.read_func = read_func ? read_func : dom_read_na; hnd.write_func = write_func ? write_func : dom_write_na; - zend_hash_str_add_mem(prop_handler, name, name_len, &hnd, sizeof(dom_prop_handler)); + str = zend_string_init_interned(name, name_len, 1); + zend_hash_add_mem(prop_handler, str, &hnd, sizeof(dom_prop_handler)); + zend_string_release(str); } /* }}} */ |