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

Method RequestBuffer

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

Source from the content-addressed store, hash-verified

539}
540
541template <typename T> T* b2ParticleSystem::RequestBuffer(T* buffer)
542{
543 if (!buffer)
544 {
545 if (m_internalAllocatedCapacity == 0)
546 {
547 ReallocateInternalAllocatedBuffers(
548 b2_minParticleSystemBufferCapacity);
549 }
550 buffer = (T*) (m_world->m_blockAllocator.Allocate(
551 sizeof(T) * m_internalAllocatedCapacity));
552 b2Assert(buffer);
553 memset(buffer, 0, sizeof(T) * m_internalAllocatedCapacity);
554 }
555 return buffer;
556}
557
558b2ParticleColor* b2ParticleSystem::GetColorBuffer()
559{

Callers

nothing calls this directly

Calls 2

memsetFunction · 0.85
AllocateMethod · 0.45

Tested by

no test coverage detected