83 |
83 |
84 BlockFreelist* block_freelist() const { return _block_freelist; } |
84 BlockFreelist* block_freelist() const { return _block_freelist; } |
85 void create_block_freelist(); |
85 void create_block_freelist(); |
86 void add_allocation_to_block_freelist(MetaWord* p, size_t word_size); |
86 void add_allocation_to_block_freelist(MetaWord* p, size_t word_size); |
87 |
87 |
88 // The current chunk is too small to service an allocation request, and we cannot enlarge |
88 // The remaining committed free space in the current chunk is chopped up and stored in the block |
89 // it in-place. Before we allocate a new chunk, take care of the remaining space in the |
89 // free list for later use. As a result, the current chunk will remain current but completely |
90 // current chunk by storing it in the deallocation freelist. |
90 // used up. This is a preparation for calling allocate_new_current_chunk(). |
91 void retire_current_chunk(); |
91 void retire_current_chunk(); |
92 |
92 |
93 // Given a requested word size, will allocate a chunk large enough to at least fit that |
93 // Given a requested word size, will allocate a chunk large enough to at least fit that |
94 // size, but may be larger according to the rules in the ChunkAllocSequence. |
94 // size, but may be larger according to internal heuristics. |
95 // Updates counters and adds the chunk to the head of the chunk list. |
95 // |
96 Metachunk* allocate_chunk_to_fit(size_t requested_word_size); |
96 // On success, it will replace the current chunk with the newly allocated one, which will |
|
97 // become the current chunk. The old current chunk should be retired beforehand. |
|
98 // |
|
99 // May fail if we could not allocate a new chunk. In that case the current chunk remains |
|
100 // unchanged and false is returned. |
|
101 bool allocate_new_current_chunk(size_t requested_word_size); |
97 |
102 |
98 // Prematurely returns a metaspace allocation to the _block_freelists |
103 // Prematurely returns a metaspace allocation to the _block_freelists |
99 // because it is not needed anymore (requires CLD lock to be active). |
104 // because it is not needed anymore (requires CLD lock to be active). |
100 void deallocate_locked(MetaWord* p, size_t word_size); |
105 void deallocate_locked(MetaWord* p, size_t word_size); |
101 |
106 |