mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Support big allocations in slab allocator.
This commit is contained in:
parent
1cefd4d8ac
commit
930190f2cb
@ -75,6 +75,23 @@ public:
|
||||
m_offset -= size;
|
||||
}
|
||||
|
||||
tracy_force_inline void* AllocBig( size_t size )
|
||||
{
|
||||
if( m_offset + size <= BlockSize )
|
||||
{
|
||||
void* ret = m_ptr + m_offset;
|
||||
m_offset += size;
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
memUsage.fetch_add( size );
|
||||
auto ret = new char[size];
|
||||
m_buffer.emplace_back( ret );
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if( m_buffer.size() > 1 )
|
||||
|
Loading…
Reference in New Issue
Block a user