mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 12:21:39 +00:00
Create memory with nullptr address if it initially fails.
This commit is contained in:
parent
25610a6249
commit
7ed7921c54
1 changed files with 3 additions and 0 deletions
|
|
@ -4,6 +4,9 @@
|
||||||
Memory::Memory(void* address, size_t size) : size(size)
|
Memory::Memory(void* address, size_t size) : size(size)
|
||||||
{
|
{
|
||||||
base = (char*)VirtualAlloc(address, size, MEM_RESERVE, PAGE_READWRITE);
|
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)
|
void* Memory::Alloc(size_t offset, size_t size, uint32_t type)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue