changeset 366: |
2b7f0c032fc7 |
parent 365: |
49c3f3d11432 |
child 367: |
494d3b93b29b |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 24 May 2024 14:51:25 -0400 |
files: |
lisp/lib/obj/hash/castable.lisp lisp/lib/obj/hash/hasher.lisp lisp/lib/obj/pkg.lisp |
description: |
fix global-hash |
1.1--- a/lisp/lib/obj/hash/castable.lisp Fri May 24 14:40:38 2024 -0400
1.2+++ b/lisp/lib/obj/hash/castable.lisp Fri May 24 14:51:25 2024 -0400
1.3@@ -121,7 +121,7 @@
1.4 (declare (optimize speed))
1.5 (let* ((cat (%counter-cat counter))
1.6 (%t (%cat-table cat))
1.7- (idx (logand +global-hash+ (1- (length %t))))
1.8+ (idx (logand *global-hash* (1- (length %t))))
1.9 (old (the fixnum (svref %t idx)))
1.10 ;; Try once quickly
1.11 (ok (sb-ext:cas (svref %t idx) (logand old (lognot mask)) (+ old x))))
2.1--- a/lisp/lib/obj/hash/hasher.lisp Fri May 24 14:40:38 2024 -0400
2.2+++ b/lisp/lib/obj/hash/hasher.lisp Fri May 24 14:51:25 2024 -0400
2.3@@ -8,7 +8,7 @@
2.4 (defvar *global-hasher* #'sxhash))
2.5
2.6 ;; TODO 2024-05-24: do better
2.7-(define-constant +global-hash+ (funcall *global-hasher* (get-universal-time)) :test #'/=)
2.8+(sb-ext:define-load-time-global *global-hash* (funcall *global-hasher* (get-universal-time)))
2.9
2.10 (macrolet ((specialize (str body) ; TODO 2023-12-21: test if this actually compiles to fastpath
2.11 `(if (typep ,str '(simple-array character 1))
3.1--- a/lisp/lib/obj/pkg.lisp Fri May 24 14:40:38 2024 -0400
3.2+++ b/lisp/lib/obj/pkg.lisp Fri May 24 14:51:25 2024 -0400
3.3@@ -35,7 +35,7 @@
3.4 :make-so-set/string :make-so-map/addr :make-marked-ref)
3.5 (:export
3.6 :*global-hasher*
3.7- :+global-hash+
3.8+ :*global-hash*
3.9 :djb
3.10 :hash-object
3.11 :hash-object-address