X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftypedefs.lisp;h=45b91042c9ca054105f306d68cf5955089b0cd8a;hb=05525d3a5906d7a89fcb689c26177732493c40ce;hp=6169aceafbb13bed42ab32a14ea34138c927dbd5;hpb=bd0ba0f214518e8d72ff2d44de5a1e3e4b02af2c;p=sbcl.git diff --git a/src/code/typedefs.lisp b/src/code/typedefs.lisp index 6169ace..45b9104 100644 --- a/src/code/typedefs.lisp +++ b/src/code/typedefs.lisp @@ -76,7 +76,7 @@ (enumerable nil :read-only t) ;; an arbitrary hash code used in EQ-style hashing of identity ;; (since EQ hashing can't be done portably) - (hash-value (random (1+ most-positive-fixnum)) + (hash-value (random #.(ash 1 20)) :type (and fixnum unsigned-byte) :read-only t) ;; Can this object contain other types? A global property of our @@ -128,6 +128,15 @@ (logand (logxor (ash (type-hash-value type1) -3) (type-hash-value type2)) #xFF)) +#!-sb-fluid (declaim (inline type-list-cache-hash)) +(declaim (ftype (function (list) (unsigned-byte 8)) type-list-cache-hash)) +(defun type-list-cache-hash (types) + (logand (loop with res = 0 + for type in types + for hash = (type-hash-value type) + do (setq res (logxor res hash)) + finally (return res)) + #xFF)) ;;;; cold loading initializations