< prev index next >
src/hotspot/share/runtime/os.cpp
Print this page
*** 1650,1671 ****
bool os::create_stack_guard_pages(char* addr, size_t bytes) {
return os::pd_create_stack_guard_pages(addr, bytes);
}
! char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, int file_desc) {
char* result = NULL;
if (file_desc != -1) {
// Could have called pd_reserve_memory() followed by replace_existing_mapping_with_file_mapping(),
// but AIX may use SHM in which case its more trouble to detach the segment and remap memory to the file.
result = os::map_memory_to_file(addr, bytes, file_desc);
if (result != NULL) {
MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC);
}
} else {
! result = pd_reserve_memory(bytes, addr, alignment_hint);
if (result != NULL) {
MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
}
}
--- 1650,1671 ----
bool os::create_stack_guard_pages(char* addr, size_t bytes) {
return os::pd_create_stack_guard_pages(addr, bytes);
}
! char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, int file_desc, bool executable) {
char* result = NULL;
if (file_desc != -1) {
// Could have called pd_reserve_memory() followed by replace_existing_mapping_with_file_mapping(),
// but AIX may use SHM in which case its more trouble to detach the segment and remap memory to the file.
result = os::map_memory_to_file(addr, bytes, file_desc);
if (result != NULL) {
MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC);
}
} else {
! result = pd_reserve_memory(bytes, addr, alignment_hint, executable);
if (result != NULL) {
MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
}
}
*** 1726,1745 ****
bool executable, const char* mesg) {
os::pd_commit_memory_or_exit(addr, size, alignment_hint, executable, mesg);
MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC);
}
! bool os::uncommit_memory(char* addr, size_t bytes) {
bool res;
if (MemTracker::tracking_level() > NMT_minimal) {
Tracker tkr(Tracker::uncommit);
! res = pd_uncommit_memory(addr, bytes);
if (res) {
tkr.record((address)addr, bytes);
}
} else {
! res = pd_uncommit_memory(addr, bytes);
}
return res;
}
bool os::release_memory(char* addr, size_t bytes) {
--- 1726,1745 ----
bool executable, const char* mesg) {
os::pd_commit_memory_or_exit(addr, size, alignment_hint, executable, mesg);
MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC);
}
! bool os::uncommit_memory(char* addr, size_t bytes, bool exec) {
bool res;
if (MemTracker::tracking_level() > NMT_minimal) {
Tracker tkr(Tracker::uncommit);
! res = pd_uncommit_memory(addr, bytes, exec);
if (res) {
tkr.record((address)addr, bytes);
}
} else {
! res = pd_uncommit_memory(addr, bytes, exec);
}
return res;
}
bool os::release_memory(char* addr, size_t bytes) {
< prev index next >