Create memory with nullptr address if it initially fails.

This commit is contained in:
Skyth 2024-10-18 20:55:39 +03:00
parent 25610a6249
commit 7ed7921c54

View file

@ -4,6 +4,9 @@
Memory::Memory(void* address, size_t size) : size(size)
{
base = (char*)VirtualAlloc(address, size, MEM_RESERVE, PAGE_READWRITE);
if (base == nullptr)
base = (char*)VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE);
}
void* Memory::Alloc(size_t offset, size_t size, uint32_t type)