template<size_t N,
Safe safety = Safe::Yes>
class psyqo::BumpAllocator< N, safety >
A bump allocator for fragments.
This allocator is used to allocate fragments without the need for dynamic memory allocation. It is useful for allocating fragments to render in a complex scene, where the number of fragments isn't known at compile time.
The allocator will need to be reset at the beginning of each frame, to ensure that the memory is properly reused. Also, don't forget to double buffer the allocator when chaining fragments allocated with it.
The allocate method works with both primitives, and custom fragments. It will always return a reference to the allocated fragment.
- Template Parameters
-
N | The size of the memory buffer in bytes. |