[plt-scheme] Weak boxes and uncollected values

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Tue Jul 25 18:23:14 EDT 2006

On 7/25/06, Robby Findler <robby at cs.uchicago.edu> wrote:
> > Are you trying to tell me mzscheme keeps around a reference to every
> > fixnum the program ever generates, just in case it might happen to
> > compute the same number again?  I don't believe you, or I'm seriously
> > misunderstanding your statement.
> In the lower-level world of one enourmous array where all values are
> references into that array, it turns out that the odd-numbered
> references aren't actually legal references (it's a strange world down
> there :) so the bit pattern for the scheme fixnum 8 is 00...010001
> (with some number of 0s in the ellipses), but there is no heap storage
> associated with this.
> So, one way to think of this situation is that the fixnum *is* the
> reference. There's no difference.

Right, but my point was that (as far as I could tell) the weak box was
not "reset" to #f, even if it was the only position in memory holding
that particular value.  (After all, what other part of the program
would have reason to hold on to 12,345,678?)  So in that way, fixnums
were (apparently) not working like other values.

In any event, I do understand GC and how it interacts with boxed and
unboxed values - I was just trying to understand the corner cases of
mzscheme weak boxes in specific.  That's been worked out in great
detail now, so thanks everyone.

Carl Eastlund

Posted on the users mailing list.