|
AGX Dynamics 2.42.3.1
|
#include <MemoryPool.h>
Inheritance diagram for agx::MemoryPoolOld< T >:Public Member Functions | |
| MemoryPoolOld (size_t initialSize=0, size_t chunkSize=64) | |
| ~MemoryPoolOld () | |
| T * | acquire () |
| size_t | capacity () const |
| \ return the total number of elements allocated | |
| void | clear () |
| Clear all memory allocated by this MemoryPoolOld. | |
| void | flush () |
| Return all elements to container. | |
| void | garbageCollect () |
| Free memory not in use. | |
| int | getAutoGarbageCollect () const |
| size_t | getChunkSize () const |
| T * | getElement () |
| T * | getElement (const T &initializer) |
| Get an element of type T, if we have ran out, then allocate a new chunks. | |
| size_t | memUsed () const |
| void | setAutoGarbageCollect (int n) |
| Set the number of calls to flush which will trigger a call to garbageCollect. | |
| void | setChunkSize (size_t size) |
| Set the new size of the chunk. | |
| void | setEnableCallConstructor (bool flag) |
| Set to true if the constructor of the elements should be called BEFORE they are returned in getElement();. | |
| void | setMaxAllocationSize (size_t numBytes) |
| Set the largest number of bytes a call to new will be. | |
| size_t | size () const |
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 *) |
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 |
Definition at line 151 of file MemoryPool.h.
| agx::MemoryPoolOld< T >::MemoryPoolOld | ( | size_t | initialSize = 0, |
| size_t | chunkSize = 64 |
||
| ) |
Definition at line 253 of file MemoryPool.h.
| agx::MemoryPoolOld< T >::~MemoryPoolOld |
Definition at line 264 of file MemoryPool.h.
|
inline |
Definition at line 178 of file MemoryPool.h.
References agx::MemoryPoolOld< T >::getElement().
| size_t agx::MemoryPoolOld< T >::capacity |
\ return the total number of elements allocated
Definition at line 308 of file MemoryPool.h.
References m_capacity.
| void agx::MemoryPoolOld< T >::clear |
Clear all memory allocated by this MemoryPoolOld.
Definition at line 371 of file MemoryPool.h.
References m_capacity, and agx::Container::SHRINK_BUFFER.
| void agx::MemoryPoolOld< T >::flush |
Return all elements to container.
Definition at line 428 of file MemoryPool.h.
| void agx::MemoryPoolOld< T >::garbageCollect |
Free memory not in use.
Based on the average allocation size (measured at each call to flush), only memory enough to store the average number of elements will be left.
Definition at line 445 of file MemoryPool.h.
References m_capacity.
| int agx::MemoryPoolOld< T >::getAutoGarbageCollect |
Definition at line 320 of file MemoryPool.h.
| size_t agx::MemoryPoolOld< T >::getChunkSize |
Definition at line 276 of file MemoryPool.h.
|
inline |
Definition at line 326 of file MemoryPool.h.
Referenced by agx::MemoryPoolOld< T >::acquire().
|
inline |
Get an element of type T, if we have ran out, then allocate a new chunks.
Definition at line 350 of file MemoryPool.h.
| size_t agx::MemoryPoolOld< T >::memUsed |
Definition at line 282 of file MemoryPool.h.
|
inline |
Set the number of calls to flush which will trigger a call to garbageCollect.
| n | - Number of calls to flush to get garbageCollect, default: -1 (never) |
Definition at line 314 of file MemoryPool.h.
| void agx::MemoryPoolOld< T >::setChunkSize | ( | size_t | size | ) |
Set the new size of the chunk.
Chunks created after this call will have this size.
Definition at line 270 of file MemoryPool.h.
|
inline |
Set to true if the constructor of the elements should be called BEFORE they are returned in getElement();.
Definition at line 295 of file MemoryPool.h.
|
inline |
Set the largest number of bytes a call to new will be.
Definition at line 301 of file MemoryPool.h.
| size_t agx::MemoryPoolOld< T >::size |
Definition at line 289 of file MemoryPool.h.