Skip to content

Commit

Permalink
Merge pull request eclipse-omr#7559 from amicic/zero_offheap_on_commi…
Browse files Browse the repository at this point in the history
…t_on_osx

Zero offheap on commit on OSX
  • Loading branch information
babsingh authored Nov 26, 2024
2 parents 32ef86c + 9e83ee1 commit f92a3f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gc/base/SparseVirtualMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ MM_SparseVirtualMemory::allocateSparseFreeEntryAndMapToHeapObject(void *proxyObj
void *sparseHeapAddr = _sparseDataPool->findFreeListEntry(adjustedSize);
bool success = MM_VirtualMemory::commitMemory(sparseHeapAddr, adjustedSize);

#if defined(OSX) || defined(OMRZTPF)
/* Most platforms will perform an implicit zero through the preceding commit. */
OMRZeroMemory(sparseHeapAddr, adjustedSize);
#endif /* defined(OSX) || defined(OMRZTPF)) */

if (NULL != sparseHeapAddr) {
_sparseDataPool->mapSparseDataPtrToHeapProxyObjectPtr(sparseHeapAddr, proxyObjPtr, adjustedSize);
} else {
Expand Down

0 comments on commit f92a3f0

Please sign in to comment.