Implement non-pointer hash tables.
authorChris Hanson <org/chris-hanson/cph>
Fri, 10 Feb 2017 08:11:39 +0000 (00:11 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 10 Feb 2017 08:11:39 +0000 (00:11 -0800)
These are like strong eq? hash tables but they don't rehash after gc.

src/runtime/hashtb.scm
src/runtime/runtime.pkg

index c41cab9985f6de604c4f8f866f03ce753a9d37e1..0eeebc207c35e14643d2f81fda2171791d42ea45 100644 (file)
@@ -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))
index 0a314dc94f2eee2abcd1d86c037baa238ddb7927..e1020f50c5565f7b5f11bdadb0a2a515eb2adf2e 100644 (file)
@@ -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!