]> gitweb.factorcode.org Git - factor.git/blob - vm/data_heap.hpp
Merge optimizations from master branch
[factor.git] / vm / data_heap.hpp
1 namespace factor
2 {
3
4 struct data_heap {
5         cell start;
6
7         cell young_size;
8         cell aging_size;
9         cell tenured_size;
10
11         cell promotion_threshold;
12
13         segment *seg;
14
15         nursery_space *nursery;
16         aging_space *aging;
17         aging_space *aging_semispace;
18         tenured_space *tenured;
19
20         card *cards;
21         card *cards_end;
22
23         card_deck *decks;
24         card_deck *decks_end;
25         
26         explicit data_heap(cell young_size, cell aging_size, cell tenured_size, cell promotion_threshold);
27         ~data_heap();
28         data_heap *grow(cell requested_size);
29         template<typename Generation> void clear_cards(Generation *gen);
30         template<typename Generation> void clear_decks(Generation *gen);
31         void reset_generation(nursery_space *gen);
32         void reset_generation(aging_space *gen);
33         void reset_generation(tenured_space *gen);
34 };
35
36 struct data_heap_room {
37         cell nursery_size;
38         cell nursery_occupied;
39         cell nursery_free;
40         cell aging_size;
41         cell aging_occupied;
42         cell aging_free;
43         cell tenured_size;
44         cell tenured_occupied;
45         cell tenured_total_free;
46         cell tenured_contiguous_free;
47         cell tenured_free_block_count;
48         cell cards;
49         cell decks;
50         cell mark_stack;
51 };
52
53 }