MCPcopy Create free account
hub / github.com/carbonengine/trinity / Allocate

Method Allocate

trinity/TriPoolAllocator.cpp:26–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void* TriPoolAllocator::Allocate( size_t size )
27{
28 // Align size to 16 bytes - pool starts out 16byte aligned - this ensures
29 // that all allocations are always 16 byte aligned.
30 size = CCP_ALIGN( size, 16 );
31
32 if( m_poolCurrent + size > m_poolEnd )
33 {
34 GetMoreSystemMemory( size );
35 if( m_poolCurrent + size > m_poolEnd )
36 {
37 return NULL;
38 }
39 }
40
41 void* ret = m_poolCurrent;
42
43 m_poolCurrent += size;
44 m_totalBytesAllocated += size;
45
46 return ret;
47}
48
49void TriPoolAllocator::Clear()
50{

Callers 3

FillVertexBufferMethod · 0.45
OnPrepareResourcesMethod · 0.45
CreateIndexBufferFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected