On Tue, Aug 21, 2018, 4:32 AM Simon Peyton Jones <[email protected]> wrote:
> That's explained in the paper. A StableName# is a pointer to a stable name > object in the heap that *contains* an index into the stable name table. > Basically, the garbage collector needs to know whether a stable name is > alive or not, so it can work out when to clear it from the table. > > Very good. But could it be explained in a Note too? The paper is from a > long time ago, contains lots of surrounding explanation, and might well be > out of date (even if it in fact is not out of date). > Certainly there should be a note, but as I mentioned in this thread, I think we can probably actually do better than we presently do. > > So the entry in the table /also/ points to the same, heap-allocated > StableName#? Doesn’t that keep it alive? Or is this akin to the treatment > of weak pointers? (Which is part of the same paper.) > The stable name table is not in the root set. All its references are weak. > > Do we anywhere keep a pointer to the object that this is a stable name of? > Yes. That's in the stable name table entry. It's also the key for the stable name hash table. >
_______________________________________________ ghc-devs mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
