]> gitweb.factorcode.org Git - factor.git/commitdiff
bootstrap: make sure to rehash hash-sets also.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 8 Mar 2013 06:04:52 +0000 (22:04 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 8 Mar 2013 06:04:52 +0000 (22:04 -0800)
core/bootstrap/stage1.factor
core/hash-sets/hash-sets.factor

index 9bc14a1188a298f0e8dc97479e1eb85759ee7284..8cbd98b686c4ebb09a322979a9b94528ecf1141d 100644 (file)
@@ -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
     ] %
 
index 21ac908ffef93cc27c9947512278e3fd5c105be2..971d4baf6fcf7430bfd1cf6922658816a76f0cc2 100644 (file)
@@ -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) ;