Exemplo n.º 1
0
        private static bool CheckForFreeAddressSpace(ulong size, bool shouldThrow)
        {
            ulong num = MemoryFailPoint.MemFreeAfterAddress(null, size);

            MemoryFailPoint.LastKnownFreeAddressSpace    = (long)num;
            MemoryFailPoint.LastTimeCheckingAddressSpace = (long)Environment.TickCount;
            if (num < size && shouldThrow)
            {
                throw new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_VAFrag"));
            }
            return(num >= size);
        }
Exemplo n.º 2
0
        private static unsafe bool CheckForFreeAddressSpace(ulong size, bool shouldThrow)
        {
            long num1;

            MemoryFailPoint.LastKnownFreeAddressSpace    = num1 = (long)MemoryFailPoint.MemFreeAfterAddress((void *)null, size);
            MemoryFailPoint.LastTimeCheckingAddressSpace = (long)Environment.TickCount;
            long num2 = (long)size;

            if ((ulong)num1 < (ulong)num2 & shouldThrow)
            {
                throw new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_VAFrag"));
            }
            long num3 = (long)size;

            return((ulong)num1 >= (ulong)num3);
        }