From: Derick Rethans Date: Tue, 7 Jun 2005 08:25:29 +0000 (+0000) Subject: - MFH: Don't crash when compiled with the zend memory manager disabled. X-Git-Tag: php-5.0.5RC1~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a235714d201b721addf3b004f6cfb41d0688318e;p=php - MFH: Don't crash when compiled with the zend memory manager disabled. --- diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index a753343463..f5826b8396 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -18,17 +18,23 @@ /* $Id$ */ + #if ZEND_DEBUG -#define emalloc_rel_orig(size) \ + +#if USE_ZEND_ALLOC +# define emalloc_rel_orig(size) \ ( __php_stream_call_depth == 0 \ ? _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ : _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) -#define erealloc_rel_orig(ptr, size) \ +# define erealloc_rel_orig(ptr, size) \ ( __php_stream_call_depth == 0 \ ? _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ : _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) - +#else +# define emalloc_rel_orig(size) emalloc(size) +# define erealloc_rel_orig(ptr, size) erealloc(ptr, size) +#endif #define pemalloc_rel_orig(size, persistent) ((persistent) ? malloc((size)) : emalloc_rel_orig((size))) #define perealloc_rel_orig(ptr, size, persistent) ((persistent) ? realloc((ptr), (size)) : erealloc_rel_orig((ptr), (size)))