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

Weak pointers and GC



   From: Bruce Krulwich <krulwich-bruce@yale.arpa>
   Date: Wed, 2 Nov 88 16:16:57 EST


   I have a question about something that's not specified in T that people on
   T-DISCUSSION might want to think about.  The question is what GC does to
   entries in the weak pointer table (ie, the OBJECT-HASH table) that are NOT
   GC'ed.  Objects in the table that are GC'ed obviously go away (that's the
   whole point of the table).

   As of now (T3.1) it seems that the table is cleared upon GC. For example,
   when I enter

	   (let ((x (object-unhash 69))) (gc))

   the object that was in (OBJECT-UNHASH 69) will not be GC'ed (because it is
   referenced in the current lexical context by X), but it will no longer be
   accessable through OBJECT-UNHASH.

   Is there any reason for this??  Keeping them in the table makes more sense 
   to me.

Your explanation is not correct.  You are calling GC tail-recursively and so
the environment containing x is not seen by the gc.  Try:


	   (let ((x (object-unhash 69))) (gc) t)

	-David