summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 4571da5686..1c81dda56f 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -106,6 +106,15 @@ static PHP_MINIT_FUNCTION(pcre)
REGISTER_LONG_CONSTANT("PREG_SPLIT_DELIM_CAPTURE", PREG_SPLIT_DELIM_CAPTURE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PREG_SPLIT_OFFSET_CAPTURE", PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PREG_GREP_INVERT", PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT);
+
+ pcre_malloc = php_pcre_malloc;
+ pcre_free = php_pcre_free;
+
+#ifdef NO_RECURSE
+ pcre_stack_malloc = php_pcre_malloc;
+ pcre_stack_free = php_pcre_free;
+#endif
+
return SUCCESS;
}
/* }}} */
@@ -121,16 +130,6 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
}
/* }}} */
-/* {{{ PHP_RINIT_FUNCTION(pcre) */
-static PHP_RINIT_FUNCTION(pcre)
-{
- pcre_malloc = php_pcre_malloc;
- pcre_free = php_pcre_free;
-
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ pcre_get_compiled_regex
*/
PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) {
@@ -1520,7 +1519,7 @@ zend_module_entry pcre_module_entry = {
pcre_functions,
PHP_MINIT(pcre),
PHP_MSHUTDOWN(pcre),
- PHP_RINIT(pcre),
+ NULL,
NULL,
PHP_MINFO(pcre),
NO_VERSION_YET,