mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Separate slab init/noinit allocation functions.
This commit is contained in:
@@ -30,7 +30,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void* Alloc( size_t size )
|
||||
void* AllocRaw( size_t size )
|
||||
{
|
||||
assert( size <= BlockSize );
|
||||
if( m_offset + size > BlockSize )
|
||||
@@ -45,10 +45,16 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* AllocInit()
|
||||
{
|
||||
return new( AllocRaw( sizeof( T ) ) ) T;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Alloc()
|
||||
{
|
||||
return new( Alloc( sizeof( T ) ) ) T;
|
||||
return (T*)AllocRaw( sizeof( T ) );
|
||||
}
|
||||
|
||||
void Unalloc( size_t size )
|
||||
|
||||
Reference in New Issue
Block a user