Remove name-based "random" hash for funcallable-instance

This commit is contained in:
Douglas Katzman 2025-06-19 08:23:52 -04:00
parent 1d6df61f23
commit f207c62c51
2 changed files with 5 additions and 5 deletions

View file

@ -65,12 +65,10 @@
(defun allocate-standard-funcallable-instance (wrapper name)
(declare (layout wrapper))
(let* ((hash (if name
;; Named functions have a predictable hash
(mix (sxhash name) (symbol-hash :generic-function)) ; arb. constant
(sb-kernel::quasi-random-address-based-hash
(declare (ignore name))
(let* ((hash (sb-kernel::quasi-random-address-based-hash
(load-time-value (make-array 1 :element-type '(and fixnum unsigned-byte)))
most-positive-fixnum)))
most-positive-fixnum))
(slots (make-array (layout-length wrapper) :initial-element +slot-unbound+))
(fin (truly-the funcallable-instance
(%make-standard-funcallable-instance

View file

@ -0,0 +1,2 @@
(test-util:with-test (:name :very-random-hashes)
(dotimes (i 10000) (fmakunbound 'foo) (eval '(defgeneric foo (a b c)))))