bootstrap: make sure to rehash hash-sets also.
parent
23078f7bd7
commit
895c6ca7c5
|
@ -1,10 +1,12 @@
|
||||||
! Copyright (C) 2004, 2009 Slava Pestov.
|
! Copyright (C) 2004, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays assocs continuations debugger generic hashtables
|
USING: arrays assocs continuations debugger destructors generic
|
||||||
init io io.files kernel kernel.private make math memory
|
hash-sets hashtables init io io.files kernel kernel.private
|
||||||
namespaces parser parser.notes prettyprint sequences splitting
|
make math memory namespaces parser parser.notes prettyprint
|
||||||
system vectors vocabs vocabs.loader words destructors ;
|
sequences splitting system vectors vocabs vocabs.loader words ;
|
||||||
QUALIFIED: bootstrap.image.private
|
QUALIFIED: bootstrap.image.private
|
||||||
|
QUALIFIED: hashtables
|
||||||
|
QUALIFIED: hash-sets
|
||||||
IN: bootstrap.stage1
|
IN: bootstrap.stage1
|
||||||
|
|
||||||
"Bootstrap stage 1..." print flush
|
"Bootstrap stage 1..." print flush
|
||||||
|
@ -20,7 +22,8 @@ load-help? off
|
||||||
[
|
[
|
||||||
! Rehash hashtables first, since bootstrap.image creates
|
! Rehash hashtables first, since bootstrap.image creates
|
||||||
! them using the host image's hashing algorithms.
|
! them using the host image's hashing algorithms.
|
||||||
[ hashtable? ] instances [ rehash ] each
|
[ hashtable? ] instances [ hashtables:rehash ] each
|
||||||
|
[ hash-set? ] instances [ hash-sets:rehash ] each
|
||||||
boot
|
boot
|
||||||
] %
|
] %
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,9 @@ M: hash-set delete ( key hash -- )
|
||||||
M: hash-set cardinality ( hash -- n )
|
M: hash-set cardinality ( hash -- n )
|
||||||
[ count>> ] [ deleted>> ] bi - ; inline
|
[ count>> ] [ deleted>> ] bi - ; inline
|
||||||
|
|
||||||
|
: rehash ( hash -- )
|
||||||
|
[ members ] [ clear-set ] [ (rehash) ] tri ;
|
||||||
|
|
||||||
M: hash-set adjoin ( key hash -- )
|
M: hash-set adjoin ( key hash -- )
|
||||||
dup ?grow-hash (adjoin) ;
|
dup ?grow-hash (adjoin) ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue