factor/vm/gc.hpp

54 lines
1.1 KiB
C++
Raw Normal View History

2013-05-11 22:04:08 -04:00
namespace factor {
2009-05-04 02:46:13 -04:00
struct must_start_gc_again {
};
enum gc_op {
2013-05-11 22:04:08 -04:00
collect_nursery_op,
collect_aging_op,
collect_to_tenured_op,
collect_full_op,
collect_compact_op,
collect_growing_data_heap_op
};
2009-10-26 23:12:44 -04:00
struct gc_event {
2013-05-11 22:04:08 -04:00
gc_op op;
data_heap_room data_heap_before;
allocator_room code_heap_before;
2013-05-11 22:04:08 -04:00
data_heap_room data_heap_after;
allocator_room code_heap_after;
2013-05-11 22:04:08 -04:00
cell cards_scanned;
cell decks_scanned;
cell code_blocks_scanned;
uint64_t start_time;
2013-05-11 22:04:08 -04:00
cell total_time;
cell card_scan_time;
cell code_scan_time;
cell data_sweep_time;
cell code_sweep_time;
cell compaction_time;
uint64_t temp_time;
2009-10-26 23:12:44 -04:00
gc_event(gc_op op, factor_vm* parent);
void reset_timer();
2013-05-11 22:04:08 -04:00
void ended_card_scan(cell cards_scanned_, cell decks_scanned_);
void ended_code_scan(cell code_blocks_scanned_);
void ended_data_sweep();
void ended_code_sweep();
void ended_compaction();
void ended_gc(factor_vm* parent);
2009-10-26 23:12:44 -04:00
};
struct gc_state {
2013-05-11 22:04:08 -04:00
gc_op op;
uint64_t start_time;
2013-05-11 22:04:08 -04:00
gc_event* event;
gc_state(gc_op op, factor_vm* parent);
2013-05-11 22:04:08 -04:00
~gc_state();
void start_again(gc_op op_, factor_vm* parent);
};
2009-05-04 02:46:13 -04:00
}