Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27544 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97523 invoked by uid 1010); 19 Jan 2007 20:09:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97508 invoked from network); 19 Jan 2007 20:09:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2007 20:09:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:34567] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/E4-60570-48521B54 for ; Fri, 19 Jan 2007 15:09:41 -0500 Received: (qmail 9512 invoked from network); 19 Jan 2007 20:07:59 -0000 Received: from office.zend.office (HELO ?127.0.0.1?) (192.168.16.109) by internal.zend.office with SMTP; 19 Jan 2007 20:07:59 -0000 Message-ID: <45B1257B.2010107@zend.com> Date: Fri, 19 Jan 2007 12:09:31 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0b1 (Windows/20061206) MIME-Version: 1.0 To: Andreas Korthaus , internals@lists.php.net References: <45B0E1EE.2030102@widescreen.ch> <45B0FC43.1090708@web.de> In-Reply-To: <45B0FC43.1090708@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PHP Object-Caching and Reference Counting From: stas@zend.com (Stanislav Malyshev) > Some time ago I created a patch to implement a ref_count() function > which works the way you suggested. But I'm not sure if it's > OK/complete... and I'm not sure if something like that is really needed > in the core (and I'm definetly not the person to decide on that ;-)). If you talk about objects, your patch exposes wrong refcount. Your patch exposes zval refcount, however there can be a number of zvals referring to the same object, and the actual object storage keeps its own refcount, see zend_objects_API.c (provided your object is a standard Zend object). Actually, since each of these zvals can hold own refcount and we can not know what variables refer to the given object, I do not see how one could really calculate the number of different places that the object is referred to, unless you know your application really well so you could know how many places refer to the object and what exactly they are. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/