Assert on OOM.

This commit is contained in:
Бранимир Караџић
2024-11-19 16:41:35 -08:00
parent e9c9d711d7
commit 4372a1f56c

View File

@@ -217,18 +217,30 @@ namespace bgfx
}
#endif // BGFX_CONFIG_MEMORY_TRACKING
return ::malloc(_size);
void* ptr = ::malloc(_size);
BX_ASSERT(NULL != ptr, "Out of memory!");
return ptr;
}
return bx::alignedAlloc(this, _size, _align, bx::Location(_file, _line) );
void* ptr = bx::alignedAlloc(this, _size, _align, bx::Location(_file, _line) );
BX_ASSERT(NULL != ptr, "Out of memory!");
return ptr;
}
if (kNaturalAlignment >= _align)
{
return ::realloc(_ptr, _size);
void* ptr = ::realloc(_ptr, _size);
BX_ASSERT(NULL != ptr, "Out of memory!");
return ptr;
}
return bx::alignedRealloc(this, _ptr, _size, _align, bx::Location(_file, _line) );
void* ptr = bx::alignedRealloc(this, _ptr, _size, _align, bx::Location(_file, _line) );
BX_ASSERT(NULL != ptr, "Out of memory!");
return ptr;
}
void checkLeaks();