mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +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)
|
||||
{
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue