Use MAKE-STRONG-EQ-HASH-TABLE for SOS's built-in class table.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 22 May 2011 21:50:50 +0000 (21:50 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 22 May 2011 21:50:50 +0000 (21:50 +0000)
Should be ephemeral of some flavour, but we can't do that yet.  See
the comments for details.

src/sos/class.scm

index bc69463356d8a62e306cdcdc9321af98e64e30f7..bd319e0d7a1a053eb4fadab4d3d22f4b711e6ff3 100644 (file)
@@ -349,8 +349,20 @@ USA.
     class))
 
 (define built-in-class-table
-  (make-eq-hash-table))
-
+  ;; This should be an ephemeral hash table of some flavour (either
+  ;; key-ephemeral or key-and-datum-ephemeral), so that, e.g., dispatch
+  ;; tags can be garbage-collected if you redefine record types.  There
+  ;; are two reasons it is not now:
+  ;;
+  ;; 1. 9.0.1 doesn't have ephemeral hash tables, and this definition
+  ;;    figures into bootstrapping, so we can't use them here until 9.1
+  ;;    is released.
+  ;;
+  ;; 2. Methods' specializers currently hold only strong references to
+  ;;    classes anyway, which have strong references to dispatch tags,
+  ;;    so they need to be changed to hold weak references.
+  (make-strong-eq-hash-table))
+\f
 (let ((assign-type
        (lambda (name class)
         (hash-table/put! built-in-class-table