|
AGXDynamics
2.31.1.0
|
Memory pool. More...
#include <MemoryPool.h>
Inheritance diagram for agx::MemoryPool< T >:Public Member Functions | |
| MemoryPool (const char *name="MemoryPool", uint32_t initialChunkSize=64) | |
| Constructor. More... | |
| virtual | ~MemoryPool () |
| Destructor. More... | |
| void * | allocate (uint32_t numBytes) |
| void * | allocate (uint32_t numBytes, uint32_t alignment) |
| T * | allocate () |
| Allocates one element, no constructor called. More... | |
| void * | allocateBytes (size_t numBytes, size_t alignment=16) |
| Allocate a memory section of specified alignment. More... | |
| void | clear () |
| Clears the memory pool and runs the destructor on every allocated object. More... | |
| void | clearFast () |
| Clears the memory pool without calling destructors. More... | |
| T * | create () |
| Allocates an element and calls its default constructor. More... | |
| void | deallocate (void *buffer) |
| void | deallocate (T *element) |
| Deallocates one element, no destructor called. More... | |
| void | deallocateBytes (void *buffer, size_t numBytes) |
| Deallocate a section previously allocated using allocateBytes method. More... | |
| void | deallocateBytes (void *buffer) |
| virtual void | deallocateVirtual (void *ptr) |
| void | destroy (T *element) |
| Deallocates an element and calls its destructor. More... | |
| const char * | getName () const |
| void | setContainer (class Container *) |
| size_t | size () |
| size_t | size () const |
Static Public Member Functions | |
| static void | initMemory (void *data, size_t numBytes, agx::UInt32 pattern) |
| static void * | standaloneAllocateBytes (size_t numBytes, size_t alignment=16) |
| static void | standaloneDeallocateTypes (void *buffer) |
Static Public Attributes | |
| static agx::UInt32 | allocatedMemoryPattern |
| static agx::UInt32 | deallocatedMemoryPattern |
| static bool | initMemoryFlag |
Protected Member Functions | |
| void | createChunk (uint32_t size) |
| size_t | deleteAllChunks () |
Protected Attributes | |
| uint32_t | m_chunkSize |
| Chunk * | m_firstChunk |
Memory pool.
Definition at line 26 of file MemoryPool.h.
| agx::MemoryPool< T >::MemoryPool | ( | const char * | name = "MemoryPool< T >", |
| uint32_t | initialChunkSize = 64 |
||
| ) |
Constructor.
Definition at line 553 of file MemoryPool.h.
|
virtual |
Destructor.
Definition at line 563 of file MemoryPool.h.
|
inlineinherited |
Definition at line 497 of file MemoryPool.h.
References agx::max().
|
inlineinherited |
Definition at line 508 of file MemoryPool.h.
References agxAssert, and agx::isPowerOfTwo().
|
inline |
Allocates one element, no constructor called.
Definition at line 571 of file MemoryPool.h.
|
inherited |
Allocate a memory section of specified alignment.
Referenced by agx::Allocator< T >::allocate(), agx::AlignedAllocator< T >::allocate(), agx::MemoryPoolOld< T >::clear(), agx::Vector< WireContactConstraintRef >::insert(), and agx::VectorPOD< agx::Vec6 >::insert().
| void agx::MemoryPool< T >::clear | ( | ) |
Clears the memory pool and runs the destructor on every allocated object.
Definition at line 616 of file MemoryPool.h.
| void agx::MemoryPool< T >::clearFast | ( | ) |
Clears the memory pool without calling destructors.
Definition at line 700 of file MemoryPool.h.
|
inline |
Allocates an element and calls its default constructor.
Definition at line 585 of file MemoryPool.h.
|
protectedinherited |
Definition at line 517 of file MemoryPool.h.
References agxVerify.
|
inline |
Deallocates one element, no destructor called.
Definition at line 593 of file MemoryPool.h.
Deallocate a section previously allocated using allocateBytes method.
Referenced by agx::MemoryPoolOld< T >::clear(), agx::Vector< WireContactConstraintRef >::clear(), agx::VectorPOD< agx::Vec6 >::clear(), agx::Allocator< T >::deallocate(), agx::AlignedAllocator< T >::deallocate(), agx::Vector< WireContactConstraintRef >::insert(), agx::VectorPOD< agx::Vec6 >::insert(), agx::Vector< WireContactConstraintRef >::~Vector(), and agx::VectorPOD< agx::Vec6 >::~VectorPOD().
Definition at line 173 of file Allocator.h.
|
virtual |
Implements agx::AbstractMemoryPool.
Definition at line 610 of file MemoryPool.h.
|
protectedinherited |
|
inline |
Deallocates an element and calls its destructor.
Definition at line 603 of file MemoryPool.h.
|
inherited |
Definition at line 164 of file Allocator.h.
|
staticinherited |
Definition at line 71 of file Allocator.h.
Referenced by agx::Vector< WireContactConstraintRef >::operator=(), agx::VectorPOD< agx::Vec6 >::operator=(), agx::Vector< WireContactConstraintRef >::Vector(), and agx::VectorPOD< agx::Vec6 >::VectorPOD().
|
inlineinherited |
Definition at line 534 of file MemoryPool.h.
References agx::BatchAllocator::Chunk::buffer, agx::BatchAllocator::Chunk::end, and agx::BatchAllocator::Chunk::next.
|
inline |
Definition at line 139 of file MemoryPool.h.
|
staticinherited |
|
staticinherited |
Definition at line 79 of file Allocator.h.
|
staticinherited |
Definition at line 80 of file Allocator.h.
|
staticinherited |
Definition at line 78 of file Allocator.h.
|
protectedinherited |
Definition at line 73 of file MemoryPool.h.
|
protectedinherited |
Definition at line 72 of file MemoryPool.h.