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