]> gitweb.factorcode.org Git - factor.git/blob - vm/data_heap.hpp
Merge branch 'work' of git://github.com/carlo-kokoth/factor
[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         segment *seg;
12
13         nursery_space *nursery;
14         aging_space *aging;
15         aging_space *aging_semispace;
16         tenured_space *tenured;
17
18         card *cards;
19         card *cards_end;
20
21         card_deck *decks;
22         card_deck *decks_end;
23         
24         explicit data_heap(cell young_size, cell aging_size, cell tenured_size);
25         ~data_heap();
26         data_heap *grow(cell requested_size);
27         template<typename Generation> void clear_cards(Generation *gen);
28         template<typename Generation> void clear_decks(Generation *gen);
29         void reset_generation(nursery_space *gen);
30         void reset_generation(aging_space *gen);
31         void reset_generation(tenured_space *gen);
32         bool low_memory_p();
33 };
34
35 struct data_heap_room {
36         cell nursery_size;
37         cell nursery_occupied;
38         cell nursery_free;
39         cell aging_size;
40         cell aging_occupied;
41         cell aging_free;
42         cell tenured_size;
43         cell tenured_occupied;
44         cell tenured_total_free;
45         cell tenured_contiguous_free;
46         cell tenured_free_block_count;
47         cell cards;
48         cell decks;
49         cell mark_stack;
50 };
51
52 }