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

On 1 Dec 2023, at 06:42, John Cowan <[email protected]> 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

Reply via email to