Hi everyone,
I'm considering merging the following two PRs:
https://github.com/php/php-src/pull/11523: Exposes the time spent in
the cycle collector via new gc_status()
fields.
https://github.com/php/php-src/pull/10932: Allows the GC to collect
certain types of cycles involving WeakMaps.
The second one introduces a minor BC break.
If there are no objections, I plan to merge these PRs prior to the
feature freeze.
Best regards,
Arnaud
Hi everyone,
I'm considering merging the following two PRs:
https://github.com/php/php-src/pull/11523: Exposes the time spent in
the cycle collector via newgc_status()
fields.
https://github.com/php/php-src/pull/10932: Allows the GC to collect
certain types of cycles involving WeakMaps.The second one introduces a minor BC break.
If there are no objections, I plan to merge these PRs prior to the
feature freeze.Best regards,
Arnaud
For the second, doesn't that translate to "WeakMaps are currently not actually Weak, and thus don't work at all?" I don't quite know how that would be a BC break to fix...
--Larry Garfield
I agree that we may not consider this a BC break, but I'm asking in
case people rely on the current behavior or if the change is more
controversial than I thought.
To be fair they work as specified in the RFC, and are actually weak as
they do not explicitly retain their keys, but they need explicit
support from the GC to be able to collect some types of cycles.
WeakMap implementations based on WeakReferences tend to have this
limitation. For instance, the Java documentation for WeakHashMap has
this warning: "The value objects in a WeakHashMap are held by ordinary
strong references. Thus care should be taken to ensure that value
objects do not strongly refer to their own keys, either directly or
indirectly, since that will prevent the keys from being discarded".
Hi everyone,
I'm considering merging the following two PRs:
https://github.com/php/php-src/pull/11523: Exposes the time spent in
the cycle collector via newgc_status()
fields.
https://github.com/php/php-src/pull/10932: Allows the GC to collect
certain types of cycles involving WeakMaps.The second one introduces a minor BC break.
If there are no objections, I plan to merge these PRs prior to the
feature freeze.Best regards,
ArnaudFor the second, doesn't that translate to "WeakMaps are currently not actually Weak, and thus don't work at all?" I don't quite know how that would be a BC break to fix...
--Larry Garfield
--
To unsubscribe, visit: https://www.php.net/unsub.php