Don't throw in the allocator, return null
This commit is contained in:
parent
4271c8583e
commit
a35e04c049
@ -12,7 +12,6 @@ module tanya.memory.mmappool;
|
||||
|
||||
import tanya.memory.allocator;
|
||||
import core.atomic;
|
||||
import core.exception;
|
||||
import core.stdc.string;
|
||||
|
||||
version (Posix)
|
||||
@ -341,10 +340,6 @@ final class MmapPool : Allocator
|
||||
0);
|
||||
if (p is MAP_FAILED)
|
||||
{
|
||||
if (errno == ENOMEM)
|
||||
{
|
||||
onOutOfMemoryError();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -356,10 +351,6 @@ final class MmapPool : Allocator
|
||||
PAGE_READWRITE);
|
||||
if (p is null)
|
||||
{
|
||||
if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY)
|
||||
{
|
||||
onOutOfMemoryError();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user