STREAMS_DC/CC macros
| From: | Zeev Suraski | Date: | Mon, 18 Mar 2002 08:13:41 +0000 |
| Subject: | STREAMS_DC/CC macros | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-81424@lists.php.net to get a copy of this message | ||
Are they really necessary? A lot of work has been done to make everything in PHP use the same thing, so I'd really like the avoid introducing new macros at this point...
I can tell that the basic difference is the use of __php_stream_call_depth, but I really can't see how you're using it :)
#define emalloc_rel_orig(size) \
( __php_stream_call_depth == 0 \
? _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) \
: _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) )
#define erealloc_rel_orig(ptr, size) \
( __php_stream_call_depth == 0 \
? _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) \
: _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) )
Am I missing something, or are the lines of code 100% identical whether __php_stream_call_depth is 0 or not? I can see that you are using it in the REL macros, but if that's the only place you're using them, it's probably better to use a special macro for that, and not replace the TSRM macro completely (you can probably put __php_stream_call_depth inside your stream globals, to avoid having move an extra variable around all the time). Also, I don't exactly understand the whole concept of this __php_stream_call_depth and why you'd like to use __zend_orig_filename instead of __zend_filename based on its value. Can you shed some light on this?
Zeev