]> gitweb.factorcode.org Git - factor.git/blob - vm/gc.hpp
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / vm / gc.hpp
1 namespace factor
2 {
3
4 enum gc_op {
5         collect_nursery_op,
6         collect_aging_op,
7         collect_to_tenured_op,
8         collect_full_op,
9         collect_growing_heap_op
10 };
11
12 /* statistics */
13 struct generation_statistics {
14         cell collections;
15         u64 gc_time;
16         u64 max_gc_time;
17         cell object_count;
18         u64 bytes_copied;
19 };
20
21 struct gc_statistics {
22         generation_statistics nursery_stats;
23         generation_statistics aging_stats;
24         generation_statistics full_stats;
25         u64 cards_scanned;
26         u64 decks_scanned;
27         u64 card_scan_time;
28         u64 code_blocks_scanned;
29 };
30
31 struct gc_state {
32         gc_op op;
33         u64 start_time;
34         jmp_buf gc_unwind;
35
36         explicit gc_state(gc_op op_);
37         ~gc_state();
38 };
39
40 VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *parent);
41
42 }