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:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to