|
AGX Dynamics 2.42.3.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. | |
| virtual | ~MemoryPool () |
| Destructor. | |
| T * | allocate () |
| Allocates one element, no constructor called. | |
| void | clear () |
| Clears the memory pool and runs the destructor on every allocated object. | |
| void | clearFast () |
| Clears the memory pool without calling destructors. | |
| T * | create () |
| Allocates an element and calls its default constructor. | |
| void | deallocate (T *element) |
| Deallocates one element, no destructor called. | |
| virtual void | deallocateVirtual (void *ptr) |
| void | destroy (T *element) |
| Deallocates an element and calls its destructor. | |
| size_t | size () const |
Public Member Functions inherited from agx::BatchAllocator | |
| BatchAllocator (const BatchAllocator &other) | |
| BatchAllocator (const char *name="BatchAllocator", uint32_t initialChunkSize=64) | |
| ~BatchAllocator () | |
| void * | allocate (uint32_t numBytes) |
| void * | allocate (uint32_t numBytes, uint32_t alignment) |
| void | clear () |
| void | deallocate (void *buffer) |
| BatchAllocator & | operator= (const BatchAllocator &other) |
| size_t | size () |
Public Member Functions inherited from agx::ByteAllocator | |
| ByteAllocator (const ByteAllocator &other) | |
| ByteAllocator (const char *name="ByteAllocator") | |
| void * | allocateBytes (size_t numBytes, size_t alignment=16) |
| Allocate a memory section of specified alignment. | |
| void | deallocateBytes (void *buffer) |
| void | deallocateBytes (void *buffer, size_t numBytes) |
| Deallocate a section previously allocated using allocateBytes method. | |
| const char * | getName () const |
| ByteAllocator & | operator= (const ByteAllocator &other) |
| void | setContainer (class Container *) |
Public Member Functions inherited from agx::AbstractMemoryPool | |
| virtual | ~AbstractMemoryPool () |
| virtual void | deallocateVirtual (void *ptr)=0 |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::ByteAllocator | |
| 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 inherited from agx::ByteAllocator | |
| static agx::UInt32 | allocatedMemoryPattern |
| static agx::UInt32 | deallocatedMemoryPattern |
| static bool | initMemoryFlag |
Protected Member Functions inherited from agx::BatchAllocator | |
| void | createChunk (uint32_t size) |
| size_t | deleteAllChunks () |
Protected Attributes inherited from agx::BatchAllocator | |
| uint32_t | m_chunkSize |
| Chunk * | m_firstChunk |
Memory pool.
Definition at line 88 of file MemoryPool.h.
| agx::MemoryPool< T >::MemoryPool | ( | const char * | name = "MemoryPool< T >", |
| uint32_t | initialChunkSize = 64 |
||
| ) |
|
virtual |
Destructor.
Definition at line 563 of file MemoryPool.h.
|
inline |
Allocates one element, no constructor called.
Definition at line 571 of file MemoryPool.h.
References agx::BatchAllocator::allocate(), and m_size.
| 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.
References agxAssert, agx::Vector< T, Allocator >::back(), agx::BatchAllocator::Chunk::buffer, agx::BatchAllocator::clear(), agx::end(), agx::BatchAllocator::Chunk::head, m_size, agx::BatchAllocator::Chunk::next, and agx::Vector< T, Allocator >::push_back().
| void agx::MemoryPool< T >::clearFast |
Clears the memory pool without calling destructors.
Definition at line 697 of file MemoryPool.h.
References agxAssert1, agx::BatchAllocator::clear(), and m_size.
|
inline |
Allocates an element and calls its default constructor.
Definition at line 585 of file MemoryPool.h.
|
inline |
Deallocates one element, no destructor called.
Definition at line 593 of file MemoryPool.h.
References m_size.
|
virtual |
Implements agx::AbstractMemoryPool.
Definition at line 610 of file MemoryPool.h.
|
inline |
Deallocates an element and calls its destructor.
Definition at line 603 of file MemoryPool.h.
|
inline |
Definition at line 139 of file MemoryPool.h.