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)?




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

Reply via email to