MCPcopy Create free account
hub / github.com/aardappel/lobster / Allocate

Method Allocate

dev/include/Box2D/Particle/b2ParticleSystem.cpp:2370–2384  ·  view source on GitHub ↗

Allocate internal storage for this object.

Source from the content-addressed store, hash-verified

2368
2369// Allocate internal storage for this object.
2370int32 FixedSetAllocator::Allocate(
2371 const int32 itemSize, const int32 count)
2372{
2373 Clear();
2374 if (count)
2375 {
2376 m_buffer = m_allocator->Allocate(
2377 (itemSize + sizeof(*m_valid)) * count);
2378 b2Assert(m_buffer);
2379 m_valid = (int8*)m_buffer + (itemSize * count);
2380 memset(m_valid, 1, sizeof(*m_valid) * count);
2381 m_count = count;
2382 }
2383 return m_count;
2384}
2385
2386// Deallocate the internal buffer if it's allocated.
2387void FixedSetAllocator::Clear()

Callers 12

ReallocateBufferMethod · 0.45
RequestBufferMethod · 0.45
CreateParticleGroupMethod · 0.45
SplitParticleGroupMethod · 0.45
ComputeDepthMethod · 0.45
FindContacts_SimdMethod · 0.45
UpdateProxies_SimdMethod · 0.45
SolveZombieMethod · 0.45
b2StackQueueMethod · 0.45
b2VoronoiDiagramMethod · 0.45
GenerateMethod · 0.45

Calls 2

memsetFunction · 0.85
ClearFunction · 0.50

Tested by

no test coverage detected