Re: Garbage collector and objects

From: Date: Mon, 31 Oct 2011 11:07:52 +0000
Subject: Re: Garbage collector and objects
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-56005@lists.php.net to get a copy of this message
I've also wrote another patch (gc-closure2.diff at https://bugs.php.net/bug.php?id=60139) that introduce new get_gc() object handler in 5.4. Thanks. Dmitry. On 10/31/2011 12:51 PM, Dmitry Stogov wrote:
Hi Gustavo, First of all, thank you for catching this. For now, I've tried to extend GC to support closures. You can find the proposed patch at https://bugs.php.net/bug.php?id=60139 However it won't work for other classes, anyway. Probably it would be better to extend object handlers in 5.4 with some uniform GC related callback, but for now I don't see how it should look like. Any ideas are welcome. Thanks. Dmitry. On 10/27/2011 08:22 PM, Gustavo Lopes wrote:
The garbage_collector currently only looks for relationships of objects by calling get_properties. This causes noncollectable cycles in many internal classes and several bug reports (the latest of which is https://bugs.php.net/bug.php?id=60139 ). The only solution I found so far is very very hacky and I'm not completely convinced it works properly: http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/spl/spl_observer.c#377 Do you think it would be possible for you to extend the current object model and possibly the garbage collector to handle these situations before 5.4 (or give me some pointers)?


« previous php.internals (#56005) next »