AGXDynamics  2.35.0.2
agx::MemoryPool< T > Class Template Reference

Memory pool. More...

#include <MemoryPool.h>

Public Member Functions

 MemoryPool (const char *name="MemoryPool", uint32_t initialChunkSize=64)
 Constructor. More...
 
virtual ~MemoryPool ()
 Destructor. More...
 
T * allocate ()
 Allocates one element, no constructor called. 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 (T *element)
 Deallocates one element, no destructor called. More...
 
virtual void deallocateVirtual (void *ptr)
 
void destroy (T *element)
 Deallocates an element and calls its destructor. More...
 
size_t size () const
 

Detailed Description

template<typename T>
class agx::MemoryPool< T >

Memory pool.

Definition at line 26 of file MemoryPool.h.

Constructor & Destructor Documentation

◆ MemoryPool()

template<typename T >
agx::MemoryPool< T >::MemoryPool ( const char *  name = "MemoryPool< T >",
uint32_t  initialChunkSize = 64 
)

Constructor.

Definition at line 553 of file MemoryPool.h.

◆ ~MemoryPool()

template<typename T >
agx::MemoryPool< T >::~MemoryPool
virtual

Destructor.

Definition at line 563 of file MemoryPool.h.

Member Function Documentation

◆ allocate()

template<typename T >
T * agx::MemoryPool< T >::allocate
inline

Allocates one element, no constructor called.

Definition at line 571 of file MemoryPool.h.

◆ clear()

template<typename T >
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.

◆ clearFast()

template<typename T >
void agx::MemoryPool< T >::clearFast

Clears the memory pool without calling destructors.

Definition at line 700 of file MemoryPool.h.

◆ create()

template<typename T >
T * agx::MemoryPool< T >::create
inline

Allocates an element and calls its default constructor.

Definition at line 585 of file MemoryPool.h.

◆ deallocate()

template<typename T >
void agx::MemoryPool< T >::deallocate ( T *  element)
inline

Deallocates one element, no destructor called.

Definition at line 593 of file MemoryPool.h.

◆ deallocateVirtual()

template<typename T >
void agx::MemoryPool< T >::deallocateVirtual ( void *  ptr)
virtual

Definition at line 610 of file MemoryPool.h.

◆ destroy()

template<typename T >
void agx::MemoryPool< T >::destroy ( T *  element)
inline

Deallocates an element and calls its destructor.

Definition at line 603 of file MemoryPool.h.

◆ size()

template<typename T >
size_t agx::MemoryPool< T >::size ( ) const
inline

Definition at line 139 of file MemoryPool.h.


The documentation for this class was generated from the following file: