factor/vm/gc.hpp

43 lines
720 B
C++
Raw Normal View History

2009-05-04 02:46:13 -04:00
namespace factor
{
enum gc_op {
collect_nursery_op,
collect_aging_op,
collect_to_tenured_op,
collect_full_op,
collect_growing_heap_op
};
2009-05-02 05:04:19 -04:00
/* statistics */
2009-10-07 09:40:28 -04:00
struct generation_statistics {
2009-05-04 05:50:24 -04:00
cell collections;
2009-05-02 05:04:19 -04:00
u64 gc_time;
u64 max_gc_time;
2009-05-04 05:50:24 -04:00
cell object_count;
2009-05-02 05:04:19 -04:00
u64 bytes_copied;
2009-05-02 11:17:05 -04:00
};
2009-05-02 05:04:19 -04:00
2009-10-07 09:40:28 -04:00
struct gc_statistics {
generation_statistics nursery_stats;
generation_statistics aging_stats;
generation_statistics full_stats;
2009-10-07 09:33:54 -04:00
u64 cards_scanned;
u64 decks_scanned;
u64 card_scan_time;
2009-10-09 00:39:54 -04:00
u64 code_blocks_scanned;
2009-10-07 09:33:54 -04:00
};
struct gc_state {
gc_op op;
u64 start_time;
jmp_buf gc_unwind;
explicit gc_state(gc_op op_);
~gc_state();
};
VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *parent);
2009-05-04 02:46:13 -04:00
}