summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-01 02:38:26 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-01 02:38:26 +0300
commited5b4d5c99a311e8c026b1aa7faf5f7b308f0b84 (patch)
treea46efb0cf1cac708c7b5775ee4902f92a8699fd3 /ext/mbstring/php_mbregex.c
parentfcb13fab6e23bd95864b6767a7cf186699b68aca (diff)
downloadphp-git-ed5b4d5c99a311e8c026b1aa7faf5f7b308f0b84.tar.gz
Use Zend MM heap
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index a2389df880..6b742560c5 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -65,7 +65,6 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
{
pglobals->default_mbctype = ONIG_ENCODING_UTF8;
pglobals->current_mbctype = ONIG_ENCODING_UTF8;
- zend_hash_init(&(pglobals->ht_rc), 0, NULL, php_mb_regex_free_cache, 1);
ZVAL_UNDEF(&pglobals->search_str);
pglobals->search_re = (php_mb_regex_t*)NULL;
pglobals->search_pos = 0;
@@ -79,7 +78,6 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
/* {{{ _php_mb_regex_globals_dtor */
static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals)
{
- zend_hash_destroy(&pglobals->ht_rc);
}
/* }}} */
@@ -126,7 +124,9 @@ PHP_MSHUTDOWN_FUNCTION(mb_regex)
/* {{{ PHP_RINIT_FUNCTION(mb_regex) */
PHP_RINIT_FUNCTION(mb_regex)
{
- return MBSTRG(mb_regex_globals) ? SUCCESS: FAILURE;
+ if (!MBSTRG(mb_regex_globals)) return FAILURE;
+ zend_hash_init(&MBREX(ht_rc), 0, NULL, php_mb_regex_free_cache, 0);
+ return SUCCESS;
}
/* }}} */
@@ -145,7 +145,7 @@ PHP_RSHUTDOWN_FUNCTION(mb_regex)
onig_region_free(MBREX(search_regs), 1);
MBREX(search_regs) = (OnigRegion *)NULL;
}
- zend_hash_clean(&MBREX(ht_rc));
+ zend_hash_destroy(&MBREX(ht_rc));
return SUCCESS;
}