From: <lut...@fr...> - 2005-08-07 14:11:48
Attachments:
patch
|
Hi, hash tables lose certain entries during rehash (this is SBCL 0.9.3.33 on x86-64): * (defvar a (make-hash-table)) A * (setf (gethash 297528130373163573 a) t) T * (gethash 297528130373163573 a) T T ;;; Force rehashing: * (dotimes (i 16) (setf (gethash i a) t)) NIL * (gethash 297528130373163573 a) NIL NIL The reason is that on 64-bit systems +MAGIC-HASH-VECTOR-VALUE+ (from "src/code/target-hash-table.lisp") is inside the range of SXHASH. In fact, I constructed the hash key above purposefully such that this expression is true: (= (sxhash 297528130373163573) SB-IMPL:+MAGIC-HASH-VECTOR-VALUE+) Here is a patch that puts +MAGIC-HASH-VECTOR-VALUE+ outside the fixnum range on 64-bit systems, too: |
From: Christophe R. <cs...@ca...> - 2005-08-08 13:27:32
|
Hi, lut...@fr... (Lutz Euler) writes: > +;; now depends on the word size. If the expression is changed, remember > +;; to change MAGIC_HASH_VECTOR_VALUE in "src/runtime/gencgc.c", too. Thanks for the patch. There is code in GENESIS which propagates the values of lisp constants (at the end of make-host-1) to C, via the constants.h generated file. Would you be willing to rework this bit so that it is propagated to C via this mechanism? You'd need to move the constant definition to a file compiled by the host compiler (say src/code/hash-table rather than src/code/target-hash-table), and request the constant's emission in the relevant place in genesis. Cheers, Christophe |
From: <lut...@fr...> - 2005-08-08 17:46:27
|
Christophe Rhodes wrote: > There is code in GENESIS which propagates the > values of lisp constants (at the end of make-host-1) to C, via the > constants.h generated file. Would you be willing to rework this bit > so that it is propagated to C via this mechanism? Yes, I will do that. It's nice to hear that such a mechanism exists. > You'd need to move > the constant definition to a file compiled by the host compiler (say > src/code/hash-table rather than src/code/target-hash-table), and > request the constant's emission in the relevant place in genesis. Thanks for these hints, they are definitely helpful for me. Yours Lutz Euler |
From: <lut...@fr...> - 2005-08-11 19:01:17
Attachments:
patch
|
Hi, Christophe Rhodes wrote > Thanks for the patch. There is code in GENESIS which propagates the > values of lisp constants (at the end of make-host-1) to C, via the > constants.h generated file. Would you be willing to rework this bit > so that it is propagated to C via this mechanism? Here is the reworked patch. There are two things I feel unsure about: Maybe the code added in genesis.lisp should be guarded by #!+gencgc? Does the fasl file version need to be incremented? |
From: Juho S. <js...@ik...> - 2005-08-16 17:35:17
|
On Thu, Aug 11, 2005 at 08:58:30PM +0200, Lutz Euler wrote: > Here is the reworked patch. Thanks, applied in 0.9.3.60. > There are two things I feel unsure about: > Maybe the code added in genesis.lisp should be guarded by #!+gencgc? IMO it's better to not clutter code with reader conditionals unless they're really neccessary. > Does the fasl file version need to be incremented? Probably. But even if not, we were apparently already due a +fasl-file-version+ bump due to other changes. -- Juho Snellman |