[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Marking weak alist vectors

From: Marius Vollmer
Subject: Re: [PATCH] Marking weak alist vectors
Date: Wed, 07 Dec 2005 01:55:29 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> IOW, property values are to be "collected" _after_ the Scheme value to
> which they are attached has been collected.

The manual talks from the perspective of a Scheme program here.  For a
Scheme program, the important information is that some object is not
collected _before_ some condition is true.  Thus, the wording in the
manual should be read as 'not before' instead of as 'strictly after'.

Maybe we should change the manual accordingly.

C code can observe the GC doing its thing (via the smob free
functions).  In order not to overconstrain the implementation of the
GC (which is pretty constrained already anyway), we have the
additional rule that there is no guarantee about the order in which
objects are swept during the sweep phase.

Why do you need this guarantee?

(If you really need this feature, I will start talking you into using
guardians to enforce some order on finalization.)

> In any case, if a value P is attached as a property of some object O,
> then O should be "collected" _before_ P.

Why? Isn't it enough to say 'P is not collected before O is unreachable'?

GC's usually don't make any guarantee about what happens with an
object it has become unreachable.  For example, once O and P become
unreachable, it would be totally acceptable for a GC to collect P but
to never get around to actually collect O.  (The GC could be
generational: O could be in the oldest generation and P in the
youngest.  The youngest generation might be collected every MiB of
allocated memory, but the oldest generation might only be collected on
weekends and during national holidays. :)

GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405

reply via email to

[Prev in Thread] Current Thread [Next in Thread]