diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2003-12-15 21:56:55 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2003-12-15 21:56:55 +0000 |
| commit | b6a3f48d86fe5b801df261d4c123a149844e4f9d (patch) | |
| tree | 73a7996eb629e8126a04ed567d5601f77e862c46 /ext/tidy/tidy.c | |
| parent | e440d4fbea0482db8e7015e9939d991eddfa3113 (diff) | |
| download | php-git-b6a3f48d86fe5b801df261d4c123a149844e4f9d.tar.gz | |
Always set panic call handler, allows us to address critical libtidy errors
from inside PHP.
When memory_limit is enabled use e* memory allocation macros to control
memory usage.
Diffstat (limited to 'ext/tidy/tidy.c')
| -rw-r--r-- | ext/tidy/tidy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 1b77e1a712..c7c43bbe11 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -156,6 +156,7 @@ zend_module_entry tidy_module_entry = { ZEND_GET_MODULE(tidy) #endif +#if MEMORY_LIMIT void *php_tidy_malloc(size_t len) { return emalloc(len); @@ -170,13 +171,12 @@ void php_tidy_free(void *buf) { efree(buf); } - +#endif void php_tidy_panic(ctmbstr msg) { zend_error(E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg); } - static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file) { char *data=NULL, *cfg_file=NULL, *arg1; @@ -297,13 +297,13 @@ static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers * break; case is_doc: -/* for debugging of libtidy only +#if MEMORY_LIMIT tidySetMallocCall(php_tidy_malloc); tidySetReallocCall(php_tidy_realloc); tidySetFreeCall(php_tidy_free); - +#endif tidySetPanicCall(php_tidy_panic); -*/ + intern->ptdoc = emalloc(sizeof(PHPTidyDoc)); intern->ptdoc->doc = tidyCreate(); intern->ptdoc->parsed = FALSE; |
