Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54016 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7177 invoked from network); 18 Jul 2011 06:01:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2011 06:01:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=lars.schultz@toolpark.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lars.schultz@toolpark.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain toolpark.com from 195.49.42.12 cause and error) X-PHP-List-Original-Sender: lars.schultz@toolpark.com X-Host-Fingerprint: 195.49.42.12 mail1.screenlight.ch Received: from [195.49.42.12] ([195.49.42.12:56929] helo=mail1.screenlight.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/10-04433-F2CC32E4 for ; Mon, 18 Jul 2011 02:01:20 -0400 Received: from [192.168.1.112] ([192.168.1.112]) (authenticated user lars.schultz@toolpark.com) by mail1.screenlight.ch (Kerio Connect 7.0.2 patch 1) (using TLSv1/SSLv3 with cipher AES256-SHA (256 bits)) for internals@lists.php.net; Mon, 18 Jul 2011 08:01:15 +0200 Message-ID: <4E23CC2B.8000802@toolpark.com> Date: Mon, 18 Jul 2011 08:01:15 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] weak references From: lars.schultz@toolpark.com (Lars Schultz) Am 16.07.2011 13:23, schrieb Ferenc Kovacs: > we have debug_zval_dump but it is hard to use correctly Well, it's not a simple problem then is it? It wouldn't be too hard if you understood the source of the problem... > with weak references, you wouldn't need to worry about keeping a count > of the refcount only check the valid() method. yeah...a magic bullet is cool, but you could, to quote a contributor to this list, shoot yourself in the foot;) > for your last paragraph: that's totally unrelated to weak references, > but you could achive what you want through memory_get_usage() + You're right. It's related to one of the usecases of weak-references though...and your proposition wouldn't works ince I'd have to check my memory-usage all the time...that's what events are for. > btw. if I remember correctly, somebody requested a non-fatal callback > when memory limit is reached callback functionality, I have to look > that up. By then it's probably too late since I don't have any memory left to run my cleanup code.