< prev index next >
src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp
Print this page
*** 70,86 ****
VM_INHERIT_COPY);
return (res == KERN_SUCCESS) ? ZErrno(0) : ZErrno(EINVAL);
}
! ZPhysicalMemoryBacking::ZPhysicalMemoryBacking() :
_base(0),
- _size(0),
_initialized(false) {
// Reserve address space for backing memory
! _base = (uintptr_t)os::reserve_memory(MaxHeapSize);
if (_base == 0) {
// Failed
log_error(gc)("Failed to reserve address space for backing memory");
return;
}
--- 70,85 ----
VM_INHERIT_COPY);
return (res == KERN_SUCCESS) ? ZErrno(0) : ZErrno(EINVAL);
}
! ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) :
_base(0),
_initialized(false) {
// Reserve address space for backing memory
! _base = (uintptr_t)os::reserve_memory(max_capacity);
if (_base == 0) {
// Failed
log_error(gc)("Failed to reserve address space for backing memory");
return;
}
*** 95,108 ****
void ZPhysicalMemoryBacking::warn_commit_limits(size_t max) const {
// Does nothing
}
- size_t ZPhysicalMemoryBacking::size() const {
- return _size;
- }
-
bool ZPhysicalMemoryBacking::commit_inner(size_t offset, size_t length) {
assert(is_aligned(offset, os::vm_page_size()), "Invalid offset");
assert(is_aligned(length, os::vm_page_size()), "Invalid length");
log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
--- 94,103 ----
*** 114,129 ****
ZErrno err;
log_error(gc)("Failed to commit memory (%s)", err.to_string());
return false;
}
- const size_t end = offset + length;
- if (end > _size) {
- // Record new size
- _size = end;
- }
-
// Success
return true;
}
size_t ZPhysicalMemoryBacking::commit(size_t offset, size_t length) {
--- 109,118 ----
< prev index next >