AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agx::BatchAllocator Class Reference

Batch allocator. More...

#include <MemoryPool.h>

+ Inheritance diagram for agx::BatchAllocator:

Classes

struct  Chunk
 

Public Member Functions

 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 *)
 

Protected Member Functions

void createChunk (uint32_t size)
 
size_t deleteAllChunks ()
 

Protected Attributes

uint32_t m_chunkSize
 
Chunk * m_firstChunk
 

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
 

Detailed Description

Batch allocator.

Definition at line 45 of file MemoryPool.h.

Constructor & Destructor Documentation

◆ BatchAllocator() [1/2]

agx::BatchAllocator::BatchAllocator ( const char *  name = "BatchAllocator",
uint32_t  initialChunkSize = 64 
)

◆ ~BatchAllocator()

agx::BatchAllocator::~BatchAllocator ( )

◆ BatchAllocator() [2/2]

agx::BatchAllocator::BatchAllocator ( const BatchAllocator &  other)

Member Function Documentation

◆ allocate() [1/2]

void * agx::BatchAllocator::allocate ( uint32_t  numBytes)
inline

◆ allocate() [2/2]

void * agx::BatchAllocator::allocate ( uint32_t  numBytes,
uint32_t  alignment 
)
inline

◆ clear()

void agx::BatchAllocator::clear ( )

◆ createChunk()

void agx::BatchAllocator::createChunk ( uint32_t  size)
protected

Referenced by allocate().

◆ deallocate()

void agx::BatchAllocator::deallocate ( void *  buffer)
inline

Definition at line 517 of file MemoryPool.h.

References agxVerify.

◆ deleteAllChunks()

size_t agx::BatchAllocator::deleteAllChunks ( )
protected

◆ operator=()

BatchAllocator & agx::BatchAllocator::operator= ( const BatchAllocator &  other)

◆ size()

size_t agx::BatchAllocator::size ( )
inline

Member Data Documentation

◆ m_chunkSize

uint32_t agx::BatchAllocator::m_chunkSize
protected

Definition at line 73 of file MemoryPool.h.

Referenced by allocate().

◆ m_firstChunk

Chunk* agx::BatchAllocator::m_firstChunk
protected

Definition at line 72 of file MemoryPool.h.

Referenced by allocate(), and size().


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