Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/ jdk21 Public archive


8309675: Generational ZGC: compiler/gcbarriers/UnsafeIntrinsicsTest.j…
Browse files Browse the repository at this point in the history
…ava fails in nmt_commit

Reviewed-by: dcubed
Backport-of: c4e6542
  • Loading branch information
stefank committed Jun 8, 2023
1 parent bb377b2 commit 430ffe7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/z/zPhysicalMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ void ZPhysicalMemoryManager::nmt_commit(zoffset offset, size_t size) const {
// When this function is called we don't know where in the virtual memory
// this physical memory will be mapped. So we fake that the virtual memory
// address is the heap base + the given offset.
const zaddress addr = ZOffset::address(offset);
MemTracker::record_virtual_memory_commit((void*)untype(addr), size, CALLER_PC);
const uintptr_t addr = ZAddressHeapBase + untype(offset);
MemTracker::record_virtual_memory_commit((void*)addr, size, CALLER_PC);

void ZPhysicalMemoryManager::nmt_uncommit(zoffset offset, size_t size) const {
if (MemTracker::enabled()) {
const zaddress addr = ZOffset::address(offset);
const uintptr_t addr = ZAddressHeapBase + untype(offset);
Tracker tracker(Tracker::uncommit);
tracker.record((address)untype(addr), size);
tracker.record((address)addr, size);

Expand Down

1 comment on commit 430ffe7

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.