Skip to content
Permalink
Browse files

Disabling checks in MemoryFailPoint for Xplat till primitives like Vi…

…rtualQuery

are implmemented properly
  • Loading branch information
ramarag committed Nov 2, 2016
1 parent 1d49a9b commit 953361eb2d4092feaf509dfc5b23edcc0146efda
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/mscorlib/src/System/Runtime/MemoryFailPoint.cs
@@ -160,6 +160,7 @@ public MemoryFailPoint(int sizeInMegabytes)
throw new ArgumentOutOfRangeException("sizeInMegabytes", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
Contract.EndContractBlock();

#if !FEATURE_PAL // Remove this when CheckForAvailableMemory is able to provide legitimate estimates
ulong size = ((ulong)sizeInMegabytes) << 20;
_reservedMemory = size;

@@ -302,6 +303,7 @@ public MemoryFailPoint(int sizeInMegabytes)
SharedStatics.AddMemoryFailPointReservation((long) size);
_mustSubtractReservation = true;
}
#endif
}

[System.Security.SecurityCritical] // auto-generated
@@ -324,9 +326,6 @@ private static void CheckForAvailableMemory(out ulong availPageFile, out ulong t
[System.Security.SecurityCritical] // auto-generated
private static unsafe bool CheckForFreeAddressSpace(ulong size, bool shouldThrow)
{
#if FEATURE_PAL // Remove this when GlobalMemoryStatusEx is able to provide legitimate estimates
return true;
#endif
// Start walking the address space at 0. VirtualAlloc may wrap
// around the address space. We don't need to find the exact
// pages that VirtualAlloc would return - we just need to

0 comments on commit 953361e

Please sign in to comment.
You can’t perform that action at this time.