PageRenderTime 65ms CodeModel.GetById 57ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/vm/gc.hpp

http://github.com/abeaumont/factor
C++ Header | 55 lines | 49 code | 6 blank | 0 comment | 0 complexity | 83fefd79c8a4ec392ac91fecad21a30d MD5 | raw file
 1namespace factor
 2{
 3
 4enum gc_op {
 5	collect_nursery_op,
 6	collect_aging_op,
 7	collect_to_tenured_op,
 8	collect_full_op,
 9	collect_compact_op,
10	collect_growing_heap_op
11};
12
13struct gc_event {
14	gc_op op;
15	data_heap_room data_heap_before;
16	code_heap_room code_heap_before;
17	data_heap_room data_heap_after;
18	code_heap_room code_heap_after;
19	cell cards_scanned;
20	cell decks_scanned;
21	cell code_blocks_scanned;
22	u64 start_time;
23	cell total_time;
24	cell card_scan_time;
25	cell code_scan_time;
26	cell data_sweep_time;
27	cell code_sweep_time;
28	cell compaction_time;
29	u64 temp_time;
30
31	gc_event(gc_op op_, factor_vm *parent);
32	void started_card_scan();
33	void ended_card_scan(cell cards_scanned_, cell decks_scanned_);
34	void started_code_scan();
35	void ended_code_scan(cell code_blocks_scanned_);
36	void started_data_sweep();
37	void ended_data_sweep();
38	void started_code_sweep();
39	void ended_code_sweep();
40	void started_compaction();
41	void ended_compaction();
42	void ended_gc(factor_vm *parent);
43};
44
45struct gc_state {
46	gc_op op;
47	u64 start_time;
48	gc_event *event;
49
50	explicit gc_state(gc_op op_, factor_vm *parent);
51	~gc_state();
52	void start_again(gc_op op_, factor_vm *parent);
53};
54
55}