AGXDynamics  2.31.1.0
agx::BatchAllocator Class Reference

Batch allocator. More...

#include <MemoryPool.h>

+ Inheritance diagram for agx::BatchAllocator:

Classes

struct  Chunk
 

Public Member Functions

 BatchAllocator (const char *name="BatchAllocator", uint32_t initialChunkSize=64)
 
 BatchAllocator (const BatchAllocator &other)
 
 ~BatchAllocator ()
 
void * allocate (uint32_t numBytes)
 
void * allocate (uint32_t numBytes, uint32_t alignment)
 
void * allocateBytes (size_t numBytes, size_t alignment=16)
 Allocate a memory section of specified alignment. More...
 
void clear ()
 
void deallocate (void *buffer)
 
void deallocateBytes (void *buffer, size_t numBytes)
 Deallocate a section previously allocated using allocateBytes method. More...
 
void deallocateBytes (void *buffer)
 
const char * getName () const
 
BatchAllocator & operator= (const BatchAllocator &other)
 
void setContainer (class Container *)
 
size_t size ()
 

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
 

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

Definition at line 497 of file MemoryPool.h.

References agx::max().

◆ allocate() [2/2]

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

Definition at line 508 of file MemoryPool.h.

References agxAssert, and agx::isPowerOfTwo().

◆ allocateBytes()

void* agx::ByteAllocator::allocateBytes ( size_t  numBytes,
size_t  alignment = 16 
)
inherited

◆ clear()

void agx::BatchAllocator::clear ( )

◆ createChunk()

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

◆ deallocate()

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

Definition at line 517 of file MemoryPool.h.

References agxVerify.

◆ deallocateBytes() [1/2]

◆ deallocateBytes() [2/2]

void agx::ByteAllocator::deallocateBytes ( void *  buffer)
inherited

Definition at line 173 of file Allocator.h.

◆ deleteAllChunks()

size_t agx::BatchAllocator::deleteAllChunks ( )
protected

◆ getName()

const char * agx::ByteAllocator::getName ( ) const
inherited
Returns
The name

Definition at line 164 of file Allocator.h.

◆ initMemory()

static void agx::ByteAllocator::initMemory ( void *  data,
size_t  numBytes,
agx::UInt32  pattern 
)
staticinherited

◆ operator=()

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

◆ setContainer()

◆ size()

size_t agx::BatchAllocator::size ( )
inline

◆ standaloneAllocateBytes()

static void* agx::ByteAllocator::standaloneAllocateBytes ( size_t  numBytes,
size_t  alignment = 16 
)
staticinherited

◆ standaloneDeallocateTypes()

static void agx::ByteAllocator::standaloneDeallocateTypes ( void *  buffer)
staticinherited

Member Data Documentation

◆ allocatedMemoryPattern

agx::UInt32 agx::ByteAllocator::allocatedMemoryPattern
staticinherited

Definition at line 79 of file Allocator.h.

◆ deallocatedMemoryPattern

agx::UInt32 agx::ByteAllocator::deallocatedMemoryPattern
staticinherited

Definition at line 80 of file Allocator.h.

◆ initMemoryFlag

bool agx::ByteAllocator::initMemoryFlag
staticinherited

Definition at line 78 of file Allocator.h.

◆ m_chunkSize

uint32_t agx::BatchAllocator::m_chunkSize
protected

Definition at line 73 of file MemoryPool.h.

◆ m_firstChunk

Chunk* agx::BatchAllocator::m_firstChunk
protected

Definition at line 72 of file MemoryPool.h.


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