Nugget
Public Member Functions | List of all members
eastl::fixed_pool Class Reference

#include <fixed_pool.h>

Inheritance diagram for eastl::fixed_pool:
Inheritance graph
[legend]
Collaboration diagram for eastl::fixed_pool:
Collaboration graph
[legend]

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 * allocate (size_t, size_t)
 
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 &)
 
EASTL_API 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.

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.

◆ 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.

Member Function Documentation

◆ 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.

◆ can_allocate()

bool eastl::fixed_pool_base::can_allocate
inline

can_allocate

Returns true if there are any free links.

◆ 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.

◆ operator=()

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

fixed_pool operator=


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