summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-07-15 17:57:22 +0000
committerFelipe Pena <felipe@php.net>2010-07-15 17:57:22 +0000
commitd9201cba392220db665934e7a1cef821f8ba532d (patch)
tree90c6bfe6e9a17ff7c1bd009d55fb401cd8e6c6c2
parent09ff94e900ce44bb9417d6b849cdf3db849996ec (diff)
downloadphp-git-d9201cba392220db665934e7a1cef821f8ba532d.tar.gz
- Lets use the _emalloc, _efree functions
-rw-r--r--Zend/zend_compile.c6
-rw-r--r--Zend/zend_compile.h4
-rw-r--r--Zend/zend_ini_parser.y10
-rw-r--r--lempar.c8
4 files changed, 14 insertions, 14 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 1f5fae8cc5..4181a224cc 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -6114,8 +6114,8 @@ int zendparse(TSRMLS_D) /* {{{ */
int token, lineno = 0, halting = 0, old_exit_status;
void *pParser;
- if ((pParser = zend_lang_parseAlloc(malloc)) == NULL) {
- zend_lang_parseFree(pParser, free);
+ if ((pParser = zend_lang_parseAlloc(_emalloc)) == NULL) {
+ zend_lang_parseFree(pParser, _efree);
return 1;
}
@@ -6177,7 +6177,7 @@ again:
break;
}
}
- zend_lang_parseFree(pParser, free);
+ zend_lang_parseFree(pParser, _efree);
if (EG(exit_status) == 255) {
/* We got an E_PARSE */
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index c5b3106f49..a86bfa9ce4 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -664,8 +664,8 @@ ZEND_API size_t zend_dirname(char *path, size_t len);
/* Parser */
int zendparse(TSRMLS_D);
-void *zend_lang_parseAlloc(void *(*mallocProc)(size_t));
-void zend_lang_parseFree(void *p, void (*freeProc)(void*));
+void *zend_lang_parseAlloc(void *(*mallocProc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC));
+void zend_lang_parseFree(void *p, void (*freeProc)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC));
void zend_lang_parse(void *yyp, int yymajor, znode yyminor TSRMLS_DC);
int zend_add_literal(zend_op_array *op_array, const zval *zv);
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 4f978edd7c..5bbc640d4c 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -39,8 +39,8 @@
#define ZEND_INI_PARSER_SE (CG(ini_parser_param))->syntax_error
int ini_parse(TSRMLS_D);
-void *zend_ini_parseAlloc(void *(*mallocProc)(size_t));
-void zend_ini_parseFree(void *p, void (*freeProc)(void*));
+void *zend_ini_parseAlloc(void *(*mallocProc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC));
+void zend_ini_parseFree(void *p, void (*freeProc)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC));
void zend_ini_parse(void *yyp, int yymajor, zval yyminor TSRMLS_DC);
/* {{{ zend_ini_do_op()
@@ -219,10 +219,10 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
int ini_parse(TSRMLS_D) /* {{{ */
{
int token;
- void *pParser = zend_ini_parseAlloc(malloc);
+ void *pParser = zend_ini_parseAlloc(_emalloc);
if (pParser == NULL) {
- zend_ini_parseFree(pParser, free);
+ zend_ini_parseFree(pParser, _efree);
return 1;
}
@@ -236,7 +236,7 @@ int ini_parse(TSRMLS_D) /* {{{ */
}
}
- zend_ini_parseFree(pParser, free);
+ zend_ini_parseFree(pParser, _efree);
if (ZEND_INI_PARSER_SE) {
return 1;
} else {
diff --git a/lempar.c b/lempar.c
index 200579b473..2ca18c67ae 100644
--- a/lempar.c
+++ b/lempar.c
@@ -266,9 +266,9 @@ static void yyGrowStack(yyParser *p){
** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree.
*/
-void *ParseAlloc(void *(*mallocProc)(size_t)){
+void *ParseAlloc(void *(*mallocProc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)){
yyParser *pParser;
- pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
+ pParser = (yyParser*)(*mallocProc)( ((size_t)sizeof(yyParser)) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC);
if( pParser ){
pParser->yyidx = -1;
#ifdef YYTRACKMAXSTACKDEPTH
@@ -351,7 +351,7 @@ static zend_always_inline int yy_pop_parser_stack(yyParser *pParser){
*/
void ParseFree(
void *p, /* The parser to be deleted */
- void (*freeProc)(void*) /* Function used to reclaim memory */
+ void (*freeProc)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* Function used to reclaim memory */
){
yyParser *pParser = (yyParser*)p;
if( pParser==0 ) return;
@@ -359,7 +359,7 @@ void ParseFree(
#if YYSTACKDEPTH<=0
free(pParser->yystack);
#endif
- (*freeProc)((void*)pParser);
+ (*freeProc)((void*)pParser ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC);
}
/*