Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17378 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48718 invoked by uid 1010); 22 Jul 2005 12:14:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 48703 invoked from network); 22 Jul 2005 12:14:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2005 12:14:49 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:50160] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id C7/D1-33635-833E0E24 for ; Fri, 22 Jul 2005 08:14:49 -0400 Received: from dhcp-215-159.onsite.apachecon.com (dhcp-215-159.onsite.apachecon.com [129.143.215.159]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id D93BB35C379; Fri, 22 Jul 2005 14:31:58 +0200 (CEST) Date: Fri, 22 Jul 2005 14:14:44 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1052764153.20050722141444@marcus-boerger.de> To: Michael Wallner Cc: internals@lists.php.net In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: static members of internal classes From: mail@marcus-boerger.de (Marcus Boerger) 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