From: Taylor R Campbell Date: Sun, 22 May 2011 21:50:50 +0000 (+0000) Subject: Use MAKE-STRONG-EQ-HASH-TABLE for SOS's built-in class table. X-Git-Tag: 20110609-Gtk~1^2~8 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7cf2ed1b97b774689051aafe68651153a1b60d12;p=mit-scheme.git Use MAKE-STRONG-EQ-HASH-TABLE for SOS's built-in class table. Should be ephemeral of some flavour, but we can't do that yet. See the comments for details. --- diff --git a/src/sos/class.scm b/src/sos/class.scm index bc6946335..bd319e0d7 100644 --- a/src/sos/class.scm +++ b/src/sos/class.scm @@ -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)) + (let ((assign-type (lambda (name class) (hash-table/put! built-in-class-table