Sierra Toolkit  Version of the Day
eastl::fixed_pool Class Reference

#include <fixed_pool_eastl.h>

Inheritance diagram for eastl::fixed_pool:
Collaboration diagram for eastl::fixed_pool:

Public Member Functions

 fixed_pool (void *pMemory=NULL)
 
 fixed_pool (void *pMemory, size_t memorySize, size_t nodeSize, size_t alignment, size_t alignmentOffset=0)
 
fixed_pooloperator= (const fixed_pool &)
 
void * allocate ()
 
void deallocate (void *p)
 
const char * get_name () const
 
void set_name (const char *)
 
bool can_allocate () const
 
- Public Member Functions inherited from eastl::fixed_pool_base
 fixed_pool_base (void *pMemory=NULL)
 
fixed_pool_baseoperator= (const fixed_pool_base &)
 
void init (void *pMemory, size_t memorySize, size_t nodeSize, size_t alignment, size_t alignmentOffset=0)
 
size_t peak_size () const
 
bool can_allocate () const
 

Additional Inherited Members

- Public Attributes inherited from eastl::fixed_pool_base
LinkmpHead
 
LinkmpNext
 
LinkmpCapacity
 
size_t mnNodeSize
 

Detailed Description

fixed_pool

Implements a simple fixed pool allocator for use by fixed-size containers. This is not a generic eastl allocator which can be plugged into an arbitrary eastl container, as it simplifies some functions are arguments for the purpose of efficiency.

Definition at line 260 of file fixed_pool_eastl.h.

Constructor & Destructor Documentation

◆ fixed_pool() [1/2]

eastl::fixed_pool::fixed_pool ( void *  pMemory = NULL)
inline

fixed_pool

Default constructor. User usually will want to call init() after constructing via this constructor. The pMemory argument is for the purposes of temporarily storing a pointer to the buffer to be used. Even though init may have a pMemory argument, this arg is useful for temporary storage, as per copy construction.

Definition at line 271 of file fixed_pool_eastl.h.

◆ fixed_pool() [2/2]

eastl::fixed_pool::fixed_pool ( void *  pMemory,
size_t  memorySize,
size_t  nodeSize,
size_t  alignment,
size_t  alignmentOffset = 0 
)
inline

fixed_pool

Constructs a fixed_pool with a given set of parameters.

Definition at line 281 of file fixed_pool_eastl.h.

Member Function Documentation

◆ operator=()

fixed_pool& eastl::fixed_pool::operator= ( const fixed_pool )
inline

operator=

Definition at line 290 of file fixed_pool_eastl.h.

◆ allocate()

void* eastl::fixed_pool::allocate ( )
inline

allocate

Allocates a new object of the size specified upon class initialization. Returns NULL if there is no more memory.

Definition at line 302 of file fixed_pool_eastl.h.

◆ deallocate()

void eastl::fixed_pool::deallocate ( void *  p)
inline

deallocate

Frees the given object which was allocated by allocate(). If the given node was not allocated by allocate() then the behaviour is undefined.

Definition at line 347 of file fixed_pool_eastl.h.

◆ can_allocate()

bool eastl::fixed_pool_base::can_allocate
inline

can_allocate

Returns true if there are any free links.

Definition at line 220 of file fixed_pool_eastl.h.


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