mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Assert on OOM.
This commit is contained in:
20
src/bgfx.cpp
20
src/bgfx.cpp
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user