Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ private static long allocateNativeInternal(long byteSize, long byteAlignment, Me
throw new OutOfMemoryError();
}
// Always allocate at least some memory so that zero-length segments have distinct
// non-zero addresses.
alignedSize = Math.max(1, alignedSize);
// non-zero addresses. If we are initializing the allocated memory, then use a minimum
// size of 8 because we init the memory with longs.
alignedSize = Math.max((init ? Long.BYTES : 1), alignedSize);

long allocationSize;
long allocationBase;
Expand Down