summaryrefslogtreecommitdiff
path: root/main/streams
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2005-06-06 01:52:18 (GMT)
committerWez Furlong <wez@php.net>2005-06-06 01:52:18 (GMT)
commit6b295266170abdc585adc7d6f6dc6fdf3315af6a (patch)
tree1a131d446d42b9617568d18ae2a49219971dc183 /main/streams
parent42ada22e0c9de8b8e2eab294f91103a90b42829b (diff)
downloadphp-6b295266170abdc585adc7d6f6dc6fdf3315af6a.tar.gz
Don't crash when compiled with the zend memory manager disabled.
Diffstat (limited to 'main/streams')
-rw-r--r--main/streams/php_streams_int.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h
index a753343..f5826b8 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)))