diff --git a/server/TracySlab.hpp b/server/TracySlab.hpp index 01c9cb02..efd01495 100644 --- a/server/TracySlab.hpp +++ b/server/TracySlab.hpp @@ -58,6 +58,26 @@ public: return (T*)ret; } + template + T* AllocInit( size_t sz ) + { + const auto size = sizeof( T ) * sz; + assert( size <= BlockSize ); + if( m_offset + size > BlockSize ) + { + DoAlloc(); + } + void* ret = m_ptr + m_offset; + T* ptr = (T*)ret; + for( size_t i=0; i tracy_force_inline T* Alloc() {