diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-11-01 19:04:54 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-11-01 19:04:54 +0300 |
commit | e2589b7d029cfe78316222493827876432cc1b88 (patch) | |
tree | cfe603900c88c8946ad7515217ac7c44f3f3bf60 /ext/zip/php_zip.c | |
parent | 990d8092a4d09648f885a71389156217e5a13db3 (diff) | |
download | php-git-e2589b7d029cfe78316222493827876432cc1b88.tar.gz |
Use interned strings for "magic" property of internal classes. (not copyied into SHM)
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r-- | ext/zip/php_zip.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index d50c735845..b5df2481e5 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -800,15 +800,20 @@ typedef struct _zip_prop_handler { static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype) /* {{{ */ { zip_prop_handler hnd; + zend_string *str; + zval tmp; hnd.read_const_char_func = read_char_func; hnd.read_int_func = read_int_func; hnd.read_const_char_from_obj_func = read_char_from_obj_func; hnd.type = rettype; - zend_hash_str_add_mem(prop_handler, name, strlen(name), &hnd, sizeof(zip_prop_handler)); + str = zend_string_init_interned(name, strlen(name), 1); + zend_hash_add_mem(prop_handler, str, &hnd, sizeof(zip_prop_handler)); /* Register for reflection */ - zend_declare_property_null(zip_class_entry, name, strlen(name), ZEND_ACC_PUBLIC); + ZVAL_NULL(&tmp); + zend_declare_property_ex(zip_class_entry, str, &tmp, ZEND_ACC_PUBLIC, NULL); + zend_string_release(str); } /* }}} */ |