Skip to content
Merged
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
9 changes: 7 additions & 2 deletions src/coreclr/pal/src/map/virtual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ VIRTUALCommitMemory(

nProtect = W32toUnixAccessControl(flProtect);
pRetVal = (void *) StartBoundary;

#ifndef TARGET_WASM
// Commit the pages
if (mprotect((void *) StartBoundary, MemSize, nProtect) != 0)
Expand Down Expand Up @@ -1581,8 +1581,13 @@ void ExecutableMemoryAllocator::TryReserveInitialMemory()

int32_t sizeOfAllocation = MaxExecutableMemorySizeNearCoreClr;
int32_t initialReserveLimit = -1;
#ifdef RLIMIT_AS
int addressSpace = RLIMIT_AS;
#else
int addressSpace = RLIMIT_DATA;
#endif
rlimit addressSpaceLimit;
if ((getrlimit(RLIMIT_AS, &addressSpaceLimit) == 0) && (addressSpaceLimit.rlim_cur != RLIM_INFINITY))
if ((getrlimit(addressSpace, &addressSpaceLimit) == 0) && (addressSpaceLimit.rlim_cur != RLIM_INFINITY))
{
// By default reserve max 20% of the available virtual address space
rlim_t initialExecMemoryPerc = 20;
Expand Down
Loading