]> gitweb.factorcode.org Git - factor.git/commitdiff
update room primitive for gengc
authorSlava Pestov <slava@factorcode.org>
Wed, 11 May 2005 04:52:27 +0000 (04:52 +0000)
committerSlava Pestov <slava@factorcode.org>
Wed, 11 May 2005 04:52:27 +0000 (04:52 +0000)
library/tools/memory.factor
native/memory.c
native/relocate.c

index a1f8436e8ca616edbdd7886614156efe180b3caf..da925d6ec8b7ad6e740137d5ca104a2ed27c170c 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factor.sf.net/license.txt for BSD license.
 IN: memory
 USING: errors generic hashtables kernel kernel-internals lists
-math namespaces prettyprint sequences stdio unparser vectors
-words ;
+math namespaces prettyprint sequences stdio strings unparser
+vectors words ;
 
 : save
     #! Save the current image.
@@ -11,7 +11,7 @@ words ;
 
 ! Printing an overview of heap usage.
 
-: kb. 1024 /i unparse write " KB" write ;
+: kb. 1024 /i unparse 6 CHAR: \s pad  write " KB" write ;
 
 : (room.) ( free total -- )
     2dup swap - swap ( free used total )
@@ -22,10 +22,12 @@ words ;
 : room. ( -- )
     room
     0 swap [
-        "Generation " write over unparse write ": " write
+        "Generation " write over unparse write ":" write
         uncons (room.) 1 +
     ] each drop
-    "Code space: " write (room.) ;
+    "Semi-space:  " write kb. terpri
+    "Cards:       " write kb. terpri
+    "Code space:  " write (room.) ;
 
 ! Some words for iterating through the heap.
 
index e839ff9c683e70ae3616a98692a940cb1acac5e5..4d3fff659cb601015fcae038c66e3f8188c84f6c 100644 (file)
@@ -5,19 +5,20 @@ void dump_generations(void)
        int i;
        for(i = 0; i < GC_GENERATIONS; i++)
        {
-               fprintf(stderr,"Generation %d: base=%d, size=%d, here=%d\n",
+               fprintf(stderr,"Generation %d: base=%lu, size=%lu, here=%lu\n",
                        i,
                        generations[i].base,
                        generations[i].limit - generations[i].base,
                        generations[i].here);
        }
 
-       fprintf(stderr,"Semispace: base=%d, size=%d, here=%d\n",
+       fprintf(stderr,"Semispace: base=%lu, size=%lu, here=%lu\n",
                prior.base,
                prior.limit - prior.base,
                prior.here);
 
-       fprintf(stderr,"Cards: base=%d, size=%d\n",cards,cards_end - cards);
+       fprintf(stderr,"Cards: base=%lu, size=%lu\n",(CELL)cards,
+               (CELL)(cards_end - cards));
 }
 
 CELL init_zone(ZONE *z, CELL size, CELL base)
@@ -60,8 +61,6 @@ void init_arena(CELL young_size, CELL aging_size)
        gc_in_progress = false;
        heap_scan = false;
        gc_time = 0;
-       
-       dump_generations();
 }
 
 void allot_profile_step(CELL a)
@@ -91,6 +90,8 @@ void primitive_room(void)
        int gen;
        box_signed_cell(compiling.limit - compiling.here);
        box_signed_cell(compiling.limit - compiling.base);
+       box_signed_cell(cards_end - cards);
+       box_signed_cell(prior.limit - prior.base);
        for(gen = GC_GENERATIONS - 1; gen >= 0; gen--)
        {
                ZONE *z = &generations[gen];
index e6b673624651699412b6506c473f3986deb6888e..f37d8d206ba0fb8968644e06e2a803779d9c4782 100644 (file)
@@ -59,10 +59,6 @@ void relocate_data()
 
        data_fixup(&userenv[BOOT_ENV]);
        data_fixup(&userenv[GLOBAL_ENV]);
-       printf("%d\n",T);
-       printf("%d\n",bignum_zero);
-       printf("%d\n",bignum_pos_one);
-       printf("%d\n",bignum_neg_one);
        data_fixup(&T);
        data_fixup(&bignum_zero);
        data_fixup(&bignum_pos_one);