equal
deleted
inserted
replaced
38 class outputStream; |
38 class outputStream; |
39 class Mutex; |
39 class Mutex; |
40 |
40 |
41 namespace metaspace { |
41 namespace metaspace { |
42 |
42 |
|
43 class BlockFreeList; |
|
44 class LeftOverManager; |
|
45 |
43 struct sm_stats_t; |
46 struct sm_stats_t; |
44 |
47 |
45 // The SpaceManager: |
48 // The SpaceManager: |
46 // - keeps a list of chunks-in-use by the class loader, as well as a current chunk used |
49 // - keeps a list of chunks-in-use by the class loader, as well as a current chunk used |
47 // to allocate from |
50 // to allocate from |
69 Metachunk* current_chunk() { return _chunks.first(); } |
72 Metachunk* current_chunk() { return _chunks.first(); } |
70 const Metachunk* current_chunk() const { return _chunks.first(); } |
73 const Metachunk* current_chunk() const { return _chunks.first(); } |
71 |
74 |
72 // Prematurely released metablocks. |
75 // Prematurely released metablocks. |
73 BlockFreelist* _block_freelist; |
76 BlockFreelist* _block_freelist; |
|
77 LeftOverManager* _lom; |
74 |
78 |
75 // Points to outside size counter which we are to increase/decrease when we allocate memory |
79 // Points to outside size counter which we are to increase/decrease when we allocate memory |
76 // on behalf of a user or when we are destroyed. |
80 // on behalf of a user or when we are destroyed. |
77 SizeAtomicCounter* const _total_used_words_counter; |
81 SizeAtomicCounter* const _total_used_words_counter; |
78 |
82 |
86 const ChunkAllocSequence* chunk_alloc_sequence() const { return _chunk_alloc_sequence; } |
90 const ChunkAllocSequence* chunk_alloc_sequence() const { return _chunk_alloc_sequence; } |
87 |
91 |
88 BlockFreelist* block_freelist() const { return _block_freelist; } |
92 BlockFreelist* block_freelist() const { return _block_freelist; } |
89 void create_block_freelist(); |
93 void create_block_freelist(); |
90 void add_allocation_to_block_freelist(MetaWord* p, size_t word_size); |
94 void add_allocation_to_block_freelist(MetaWord* p, size_t word_size); |
|
95 |
|
96 LeftOverManager* lom() const { return _lom; } |
|
97 void create_lom(); |
|
98 void add_allocation_to_lom(MetaWord* p, size_t word_size); |
91 |
99 |
92 // The remaining committed free space in the current chunk is chopped up and stored in the block |
100 // The remaining committed free space in the current chunk is chopped up and stored in the block |
93 // free list for later use. As a result, the current chunk will remain current but completely |
101 // free list for later use. As a result, the current chunk will remain current but completely |
94 // used up. This is a preparation for calling allocate_new_current_chunk(). |
102 // used up. This is a preparation for calling allocate_new_current_chunk(). |
95 void retire_current_chunk(); |
103 void retire_current_chunk(); |