7#include <Common/assertion.h>
14template<
typename T,
typename... Args>
19 m_memoryBlock = allocNextBlock();
23 T* ptr = m_memoryBlock->
make<
T>(std::forward<Args>(args)...);
26 m_memoryBlock = allocNextBlock();
27 ptr = m_memoryBlock->
make<
T>(std::forward<Args>(args)...);
38 PH_ASSERT_GT(arraySize, 0);
42 m_memoryBlock = allocNextBlock();
48 bool mayFitDefaultBlock =
sizeof(
T) * arraySize <= m_memoryBlock->numAllocatedBytes();
51 if(mayFitDefaultBlock)
57 m_memoryBlock = allocNextBlock();
70 PH_ASSERT(arr.data());
T * make(Args &&... args)
Make an object of type T as if by calling its constructor with Args.
Definition GraphicsArena.ipp:15
TSpan< T > makeArray(std::size_t arraySize)
Make an array of default constructed objects of type T.
Definition GraphicsArena.ipp:36
Definition GraphicsMemoryBlock.h:13
T * make(Args &&... args)
Make an object of type T as if by calling its constructor with Args.
Definition GraphicsMemoryBlock.ipp:38
TSpan< T > makeArray(std::size_t arraySize)
Make an array of default constructed objects of type T.
Definition GraphicsMemoryBlock.ipp:53
std::size_t numUsedBytes() const
Definition GraphicsMemoryBlock.ipp:20
Definition PlatformDisplay.h:13