]> gitweb.factorcode.org Git - factor.git/commitdiff
moved global state from data_gc into vm
authorPhil Dawes <phil@phildawes.net>
Mon, 17 Aug 2009 20:37:12 +0000 (21:37 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 16 Sep 2009 07:16:24 +0000 (08:16 +0100)
vm/data_gc.cpp
vm/data_gc.hpp
vm/vm.hpp

index ac0402b47d8fde4d0fff515ced644ed34b3ea18a..408a70ea5e4362cad344ebf6f1d2ab673c36eb5c 100755 (executable)
@@ -3,36 +3,6 @@
 namespace factor
 {
 
-/* used during garbage collection only */
-zone *newspace;
-bool performing_gc;
-bool performing_compaction;
-cell collecting_gen;
-
-/* if true, we are collecting aging space for the second time, so if it is still
-full, we go on to collect tenured */
-bool collecting_aging_again;
-
-/* in case a generation fills up in the middle of a gc, we jump back
-up to try collecting the next generation. */
-jmp_buf gc_jmp;
-
-gc_stats stats[max_gen_count];
-u64 cards_scanned;
-u64 decks_scanned;
-u64 card_scan_time;
-cell code_heap_scans;
-
-/* What generation was being collected when copy_code_heap_roots() was last
-called? Until the next call to add_code_block(), future
-collections of younger generations don't have to touch the code
-heap. */
-cell last_code_heap_scan;
-
-/* sometimes we grow the heap */
-bool growing_data_heap;
-data_heap *old_data_heap;
-
 void factorvm::init_data_gc()
 {
        performing_gc = false;
index 47d2657587413ddda3d29fecf0563f29d6cdf0a3..68b2b4a9365dfc1c6356688234ce25cff05c70b4 100755 (executable)
@@ -10,14 +10,6 @@ struct gc_stats {
        u64 bytes_copied;
 };
 
-extern zone *newspace;
-
-extern bool performing_compaction;
-extern cell collecting_gen;
-extern bool collecting_aging_again;
-
-extern cell last_code_heap_scan;
-
 void init_data_gc();
 
 void gc();
@@ -41,8 +33,6 @@ void clear_gc_stats();
 PRIMITIVE(clear_gc_stats);
 PRIMITIVE(become);
 
-extern bool growing_data_heap;
-
 
 VM_ASM_API void inline_gc(cell *gc_roots_base, cell gc_roots_size);
 
index a58ac1ad9eecc19f33569eadaeba5c1b2f187b90..59d9d277f83d426a60bbf41f387ac8c82bdefee1 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -170,6 +170,36 @@ struct factorvm {
 
 
        //data_gc
+       /* used during garbage collection only */
+       zone *newspace;
+       bool performing_gc;
+       bool performing_compaction;
+       cell collecting_gen;
+
+       /* if true, we collecting aging space for the second time, so if it is still
+          full, we go on to collect tenured */
+       bool collecting_aging_again;
+
+       /* in case a generation fills up in the middle of a gc, we jump back
+          up to try collecting the next generation. */
+       jmp_buf gc_jmp;
+
+       gc_stats stats[max_gen_count];
+       u64 cards_scanned;
+       u64 decks_scanned;
+       u64 card_scan_time;
+       cell code_heap_scans;
+
+       /* What generation was being collected when copy_code_heap_roots() was last
+          called? Until the next call to add_code_block(), future
+          collections of younger generations don't have to touch the code
+          heap. */
+       cell last_code_heap_scan;
+
+       /* sometimes we grow the heap */
+       bool growing_data_heap;
+       data_heap *old_data_heap;
+
        void init_data_gc();
        object *copy_untagged_object_impl(object *pointer, cell size);
        object *copy_object_impl(object *untagged);