mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Always user Zend memory allocation wrappers.
This commit is contained in:
parent
ae4a09b239
commit
664268b037
1 changed files with 1 additions and 4 deletions
|
@ -156,7 +156,6 @@ zend_module_entry tidy_module_entry = {
|
||||||
ZEND_GET_MODULE(tidy)
|
ZEND_GET_MODULE(tidy)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MEMORY_LIMIT
|
|
||||||
void *php_tidy_malloc(size_t len)
|
void *php_tidy_malloc(size_t len)
|
||||||
{
|
{
|
||||||
return emalloc(len);
|
return emalloc(len);
|
||||||
|
@ -171,7 +170,7 @@ void php_tidy_free(void *buf)
|
||||||
{
|
{
|
||||||
efree(buf);
|
efree(buf);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
void php_tidy_panic(ctmbstr msg)
|
void php_tidy_panic(ctmbstr msg)
|
||||||
{
|
{
|
||||||
zend_error(E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg);
|
zend_error(E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg);
|
||||||
|
@ -297,11 +296,9 @@ static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers *
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case is_doc:
|
case is_doc:
|
||||||
#if MEMORY_LIMIT
|
|
||||||
tidySetMallocCall(php_tidy_malloc);
|
tidySetMallocCall(php_tidy_malloc);
|
||||||
tidySetReallocCall(php_tidy_realloc);
|
tidySetReallocCall(php_tidy_realloc);
|
||||||
tidySetFreeCall(php_tidy_free);
|
tidySetFreeCall(php_tidy_free);
|
||||||
#endif
|
|
||||||
tidySetPanicCall(php_tidy_panic);
|
tidySetPanicCall(php_tidy_panic);
|
||||||
|
|
||||||
intern->ptdoc = emalloc(sizeof(PHPTidyDoc));
|
intern->ptdoc = emalloc(sizeof(PHPTidyDoc));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue