From: Chris Hanson Date: Fri, 10 Feb 2017 08:11:39 +0000 (-0800) Subject: Implement non-pointer hash tables. X-Git-Tag: mit-scheme-pucked-9.2.12~220^2~154 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=871509429a1404a6cd5137377505f355a46d708f;p=mit-scheme.git Implement non-pointer hash tables. These are like strong eq? hash tables but they don't rehash after gc. --- diff --git a/src/runtime/hashtb.scm b/src/runtime/hashtb.scm index c41cab998..0eeebc207 100644 --- a/src/runtime/hashtb.scm +++ b/src/runtime/hashtb.scm @@ -1196,6 +1196,7 @@ USA. (define key-weak-eq-hash-table-type) (define key-ephemeral-eqv-hash-table-type) (define key-weak-eqv-hash-table-type) +(define non-pointer-hash-table-type) (define string-hash-table-type) (define strong-eq-hash-table-type) (define strong-eqv-hash-table-type) @@ -1230,6 +1231,8 @@ USA. (make eqv-hash-mod eqv? #t hash-table-entry-type:key-weak)) (set! key-ephemeral-eqv-hash-table-type (make eqv-hash-mod eqv? #t hash-table-entry-type:key-ephemeral)) + (set! non-pointer-hash-table-type ;Open-coded + (open-type! eq-hash-mod eq? #f hash-table-entry-type:strong)) (set! string-hash-table-type (make ustring-hash ustring=? #t hash-table-entry-type:strong)) (set! strong-eq-hash-table-type ;Open-coded @@ -1243,6 +1246,7 @@ USA. (define make-key-weak-eq-hash-table) (define make-key-ephemeral-eqv-hash-table) (define make-key-weak-eqv-hash-table) +(define make-non-pointer-hash-table) (define make-string-hash-table) (define make-strong-eq-hash-table) (define make-strong-eqv-hash-table) @@ -1259,6 +1263,7 @@ USA. (init make-key-weak-eq-hash-table key-weak-eq-hash-table-type) (init make-key-ephemeral-eqv-hash-table key-ephemeral-eqv-hash-table-type) (init make-key-weak-eqv-hash-table key-weak-eqv-hash-table-type) + (init make-non-pointer-hash-table non-pointer-hash-table-type) (init make-string-hash-table string-hash-table-type) (init make-strong-eq-hash-table strong-eq-hash-table-type) (init make-strong-eqv-hash-table strong-eqv-hash-table-type)) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 0a314dc94..e1020f50c 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -2541,9 +2541,11 @@ USA. make-key-ephemeral-eqv-hash-table make-key-weak-eq-hash-table make-key-weak-eqv-hash-table + make-non-pointer-hash-table make-string-hash-table make-strong-eq-hash-table make-strong-eqv-hash-table + non-pointer-hash-table-type set-equality-predicate-hasher! set-hash-table/rehash-size! set-hash-table/rehash-threshold!