Re: [VOTE] Weak References
| From: | Nicolas Grekas | Date: | Fri, 02 Sep 2011 12:25:15 +0000 |
| Subject: | Re: [VOTE] Weak References | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55083@lists.php.net to get a copy of this message | ||
How about adding weak maps to this RFC?
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/WeakMap
This would be fantastic!
Nicolas
On Tue, Aug 9, 2011 at 14:55, Lars Schultz <lars.schultz@toolpark.com>wrote:
> Am 09.08.2011 14:22, schrieb Arvids Godjuks:
>
> I have mixed feelings about this proposal - from one point it's quite
>> neat - ability to mark circular references for the memory manager so
>> it can free them sounds very delicious, especially for some cases. I
>> had run into my own bunch of problems with memory in PHP in the past
>> and right now I'm running a daemon written in PHP in production on
>> 5.3.6. Careful construction and knowledge that circular references
>> actually do harm I did add safeguards that actually clean up the
>> objects in recursive manner (and objects have internal flags that
>> cleanup has been initiated - that way I make sure I cleanup the same
>> object only once). That sort of planing at the design stage makes it
>> far more friendly with memory, so it doesn't mean that PHP should have
>> soft references.
>>
>
> Exactly what I did;)
>
>
> My opinion is that if this can be done without using significant
>> resources and will not have major issues while implementing - it can
>> be added, otherwise just skip it - better off fixing bugs and
>> optimizing :)
>>
>
> Of course. I am not saying that its a must have...just wanted to defend it
> from being marked as useless.
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>