mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8065894: CodeHeap::next_free should be renamed
Rename next_free() to next_used() Reviewed-by: thartmann, iveresov
This commit is contained in:
parent
53821ffdfa
commit
b5909f6d03
2 changed files with 9 additions and 7 deletions
|
@ -279,10 +279,12 @@ size_t CodeHeap::alignment_offset() const {
|
|||
return sizeof(HeapBlock) & (_segment_size - 1);
|
||||
}
|
||||
|
||||
// Finds the next free heapblock. If the current one is free, that it returned
|
||||
void* CodeHeap::next_free(HeapBlock* b) const {
|
||||
// Since free blocks are merged, there is max. on free block
|
||||
// between two used ones
|
||||
// Returns the current block if available and used.
|
||||
// If not, it returns the subsequent block (if available), NULL otherwise.
|
||||
// Free blocks are merged, therefore there is at most one free block
|
||||
// between two used ones. As a result, the subsequent block (if available) is
|
||||
// guaranteed to be used.
|
||||
void* CodeHeap::next_used(HeapBlock* b) const {
|
||||
if (b != NULL && b->free()) b = next_block(b);
|
||||
assert(b == NULL || !b->free(), "must be in use or at end of heap");
|
||||
return (b == NULL) ? NULL : b->allocated_space();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue