mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-01 00:02:37 +00:00
8276067: ZGC: Remove unused function alloc_high_address_at_most()
Reviewed-by: eosterlund, stefank
This commit is contained in:
parent
593401fe8b
commit
d88b89f896
@ -172,31 +172,6 @@ uintptr_t ZMemoryManager::alloc_high_address(size_t size) {
|
||||
return UINTPTR_MAX;
|
||||
}
|
||||
|
||||
uintptr_t ZMemoryManager::alloc_high_address_at_most(size_t size, size_t* allocated) {
|
||||
ZLocker<ZLock> locker(&_lock);
|
||||
|
||||
ZMemory* area = _freelist.last();
|
||||
if (area != NULL) {
|
||||
if (area->size() <= size) {
|
||||
// Smaller than or equal to requested, remove area
|
||||
const uintptr_t start = area->start();
|
||||
*allocated = area->size();
|
||||
_freelist.remove(area);
|
||||
destroy(area);
|
||||
return start;
|
||||
} else {
|
||||
// Larger than requested, shrink area
|
||||
shrink_from_back(area, size);
|
||||
*allocated = size;
|
||||
return area->end();
|
||||
}
|
||||
}
|
||||
|
||||
// Out of memory
|
||||
*allocated = 0;
|
||||
return UINTPTR_MAX;
|
||||
}
|
||||
|
||||
void ZMemoryManager::free(uintptr_t start, size_t size) {
|
||||
assert(start != UINTPTR_MAX, "Invalid address");
|
||||
const uintptr_t end = start + size;
|
||||
|
||||
@ -86,7 +86,6 @@ public:
|
||||
uintptr_t alloc_low_address(size_t size);
|
||||
uintptr_t alloc_low_address_at_most(size_t size, size_t* allocated);
|
||||
uintptr_t alloc_high_address(size_t size);
|
||||
uintptr_t alloc_high_address_at_most(size_t size, size_t* allocated);
|
||||
|
||||
void free(uintptr_t start, size_t size);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user