Common/MemArena: A zero-byte allocation is invalid.

This commit is contained in:
Admiral H. Curtiss 2023-09-07 14:41:24 +02:00
commit 422bc7a627
No known key found for this signature in database
GPG key ID: F051B4C4044F33FB
3 changed files with 9 additions and 0 deletions

View file

@ -445,6 +445,9 @@ void* LazyMemoryRegion::Create(size_t size)
{
ASSERT(!m_memory);
if (size == 0)
return nullptr;
void* memory = VirtualAlloc(nullptr, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
if (!memory)
{