Re: Re: static members of internal classes

From: Date: Fri, 22 Jul 2005 12:14:44 +0000
Subject: Re: Re: static members of internal classes
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-17378@lists.php.net to get a copy of this message
Hello Michael, sure but there's a difference Reflection whatever is only run during request time, what you want is running outside and require malloc rather than emalloc. Thursday, July 21, 2005, 4:30:59 PM, you wrote: > I wrote: >> I have some issues with static members of internal classes. >> AFAICS no extension uses them so far (did I miss something?). > I cannot declare static properties as strings because that causes > memory errors in zval_dtor() (SET_STATIC_PROP_EX code is actually > the same as in ReflectionClass::setStaticPropertyValue), further > the strings duplicated by zval_copy_ctor() leak once. > Any advice? > # define GET_STATIC_PROP_EX(ce, n) > zend_std_get_static_property(ce, (#n), sizeof(#n), 0 TSRMLS_CC) > # define SET_STATIC_PROP_EX(ce, n, v) \ > { \ > int refcount; \ > zend_uchar is_ref; \ > zval **__static = GET_STATIC_PROP_EX(ce, n); \ > \ > refcount = (*__static)->refcount; \ > is_ref = (*__static)->is_ref; \ > zval_dtor(*__static); \ > **__static = *(v); \ > zval_copy_ctor(*__static); \ > (*__static)->refcount = refcount; \ > (*__static)->is_ref = is_ref; \ > } > Thanks, > -- > Michael - < mike(@)php.net > -- Best regards, Marcus mailto:mail@marcus-boerger.de

« previous php.internals (#17378) next »