diff --git a/core/bootstrap/stage1.factor b/core/bootstrap/stage1.factor index 9bc14a1188..8cbd98b686 100644 --- a/core/bootstrap/stage1.factor +++ b/core/bootstrap/stage1.factor @@ -1,10 +1,12 @@ ! Copyright (C) 2004, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays assocs continuations debugger generic hashtables -init io io.files kernel kernel.private make math memory -namespaces parser parser.notes prettyprint sequences splitting -system vectors vocabs vocabs.loader words destructors ; +USING: arrays assocs continuations debugger destructors generic +hash-sets hashtables init io io.files kernel kernel.private +make math memory namespaces parser parser.notes prettyprint +sequences splitting system vectors vocabs vocabs.loader words ; QUALIFIED: bootstrap.image.private +QUALIFIED: hashtables +QUALIFIED: hash-sets IN: bootstrap.stage1 "Bootstrap stage 1..." print flush @@ -20,7 +22,8 @@ load-help? off [ ! Rehash hashtables first, since bootstrap.image creates ! 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 ] % diff --git a/core/hash-sets/hash-sets.factor b/core/hash-sets/hash-sets.factor index 21ac908ffe..971d4baf6f 100644 --- a/core/hash-sets/hash-sets.factor +++ b/core/hash-sets/hash-sets.factor @@ -103,6 +103,9 @@ M: hash-set delete ( key hash -- ) M: hash-set cardinality ( hash -- n ) [ count>> ] [ deleted>> ] bi - ; inline +: rehash ( hash -- ) + [ members ] [ clear-set ] [ (rehash) ] tri ; + M: hash-set adjoin ( key hash -- ) dup ?grow-hash (adjoin) ;