]> gitweb.factorcode.org Git - factor.git/blob - vm/data_heap.hpp
audio.engine.test: cleanup using
[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   // Borrowed reference to a factor_vm::nursery
13   bump_allocator* 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   data_heap(bump_allocator* vm_nursery,
25             cell young_size,
26             cell aging_size,
27             cell tenured_size);
28   ~data_heap();
29   data_heap* grow(bump_allocator* vm_nursery, cell requested_size);
30   template <typename Generation> void clear_cards(Generation* gen);
31   template <typename Generation> void clear_decks(Generation* gen);
32   void reset_nursery();
33   void reset_aging();
34   void reset_tenured();
35   bool high_fragmentation_p();
36   bool low_memory_p();
37   void mark_all_cards();
38   cell high_water_mark() { return nursery->size + aging->size; }
39 };
40
41 struct data_heap_room {
42   cell nursery_size;
43   cell nursery_occupied;
44   cell nursery_free;
45   cell aging_size;
46   cell aging_occupied;
47   cell aging_free;
48   cell tenured_size;
49   cell tenured_occupied;
50   cell tenured_total_free;
51   cell tenured_contiguous_free;
52   cell tenured_free_block_count;
53   cell cards;
54   cell decks;
55   cell mark_stack;
56 };
57
58 }