Re: Repetitive calling of Z_STRLEN_P(value) in ext/filter/logical_filter.c

From: Date: Wed, 07 Apr 2010 16:10:51 +0000
Subject: Re: Repetitive calling of Z_STRLEN_P(value) in ext/filter/logical_filter.c
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-47825@lists.php.net to get a copy of this message
Justin Dearing wrote: > Hey, > > Sorry for pestering with excessive questions, but I've not done a lot of C > programming. > > In filter.c, specificalyl in php_filter_validate_ip(), Z_STRLEN_P(value) > gets called a lot. I know compilers tend to inline short functions, but are > they smart enough to assign a variable to a repetive macro expansion? Z_STRLEN_P is just a macro that expands to a variant of Z_STRLEN, which in turn is just (zval).value.str.len. These macros will be expanded by the preprocessor before the code is actually compiled. http://php-og.mgdm.net/opengrok/xref/PHP_5_3/Zend/zend_operators.h#Z_STRLEN_P Michael

« previous php.internals (#47825) next »