Hi Eliot --
vm-dev in CC
I am currently looking into using ephemerons in Squeak Trunk. There, I noticed the possibility to also let the VM/GC enqueue weaklings into the mourning-queue. Even in Pharo 12, I could not find this feature used. Only ephemeron mourning, no weakling mourning.
Is this an older feature? To me, it seems that mourning over ephemerons should be enough to provide robust and efficient in-image finalization (or just removal from surrounding containers, e.g., action maps).
If we would mourn over all weaklings as well, we could potentially get notified about every element in a larger WeakArray being nil'ed ... with #mourn being a no-op because this is how many larger WeakArrays are used: only the next insert/remove will check for the next possible slot or whether to grow/shrink. No "finalization" needed there.
So ... at this time ... there a benefit of enabling weakling-finalization besides ephemeron-based finalization?
(Note that this is unrelated to have a finalization semaphore being signalled whenver we should start processing the mourning queue. So, the comment in #supportsQueueingFinalization: is a bit misleading.)
Best,
Marcel