Re: Re: [PHP-DEV] Patch for macros for tracking refcount and is_ref

From: Date: Tue, 04 Sep 2007 16:24:20 +0000
Subject: Re: Re: [PHP-DEV] Patch for macros for tracking refcount and is_ref
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-32038@lists.php.net to get a copy of this message
About the patch, the zval_*_p() functions don't really need to exist.. they can be macros as well.
As I said, if those were macros, it would be very difficult to squeeze more than one statement into them. Having multiple statements in Z_DELREF_P will also break that code. It seems to me inline functions are the best solution (the second best solution would be to put braces around the statements in the define, but then no return value would be possible).
currently you only have one statement in each of those functions.. anyway it's not critical to have static inline functions.
(and the online keyword is also handled by the Zend engine)
Do you mean ZEND_VM_ALWAYS_INLINE? There is a ZEND_VM_ALWAYS_INLINE #define that does something similar to my "always_inline". However, it doesn't work for Microsoft compilers, and since it doesn't include the "inline" keyword within its definition, I'd have to change the meaning of it in order to fix that. As far as I can tell, it's not referenced by any code at all, but that still might be a bad idea.
nops. The Zend engine redefines the inline keyword itself somewhere. Nuno

« previous php.internals (#32038) next »