Feature request: guardian-try-collect Daphne Preston-Kendal (30 Nov 2023 23:33 UTC)
(missing)
Re: Feature request: guardian-try-collect Daphne Preston-Kendal (01 Dec 2023 07:56 UTC)
Re: Feature request: guardian-try-collect John Cowan (03 Dec 2023 05:16 UTC)
Re: Feature request: guardian-try-collect Daphne Preston-Kendal (03 Dec 2023 09:45 UTC)
Re: Feature request: guardian-try-collect John Cowan (03 Dec 2023 17:51 UTC)
Re: Feature request: guardian-try-collect Daphne Preston-Kendal (04 Dec 2023 12:19 UTC)
Re: Feature request: guardian-try-collect Marc Nieper-Wißkirchen (14 Dec 2023 15:06 UTC)

Re: Feature request: guardian-try-collect Daphne Preston-Kendal 01 Dec 2023 07:56 UTC

(putting the list back in CC since I assume you forgot to reply all)

On 1 Dec 2023, at 06:42, John Cowan <xxxxxx@ccil.org> wrote:

> What is the effect if no amount of collection will enqueue one object, as for example if none of the accessible objects are garbage?

If there are no objects the guardian is protecting which aren’t already enqueued, guardian-try-collect is a no-op.

Likewise if there are already objects enqueued in the guardian, it’s a no-op.

If the guardian is protecting objects but none of them can yet be enqueued, the garbage collector can stop trying to collect items as soon as it has all of the non-enqueued objects being protected by the GC (usually generationally — i.e. it can stop collecting as soon as it has looked in the oldest generation which still has a protected and non-enqueued object in the guardian). This effectively makes guardian-try-collect a no-op, except that running it may cause other ephemerons to be broken or other guardians to have objects enqueued.

If the garbage collector is non-generational or otherwise can’t trace individual objects with that amount of granularity, guardian-try-collect might cause a full garbage collection. guardian-try-collect should be specified to try to do *at least* as much collection as needed to enqueue one item.

In all cases, guardian-try-collect returns the unspecified value.

Daphne