Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZStd::static_pool_allocator< Node, NumNodes > Class Template Reference

#include <allocator_static.h>

Public Types

using pointer = void *
 
using size_type = AZStd::size_t
 
using difference_type = AZStd::ptrdiff_t
 

Public Member Functions

AZ_FORCE_INLINE static_pool_allocator (const this_type &)
 
AZ_FORCE_INLINE this_typeoperator= (const this_type &)
 
constexpr size_type max_size () const
 
AZ_FORCE_INLINE size_type get_allocated_size () const
 
Node * allocate ()
 
pointer allocate (size_type byteSize, size_type alignment, int flags=0)
 
void deallocate (Node *ptr)
 
void deallocate (pointer ptr, size_type byteSize, size_type alignment)
 
AZ_FORCE_INLINE size_type resize (pointer ptr, size_type newSize)
 
void reset ()
 
void leak_before_destroy ()
 
AZ_FORCE_INLINE void * data () const
 
AZ_FORCE_INLINE constexpr size_type data_size () const
 

Detailed Description

template<class Node, AZStd::size_t NumNodes>
class AZStd::static_pool_allocator< Node, NumNodes >

Declares a static buffer of Node[NumNodes], and them pools them. This is perfect allocator for pooling list or hash table nodes. Internally the buffer is allocated using aligned_storage.

Note
This is not thread safe allocator.
be careful if you use this on the stack, since many platforms do NOT support alignment more than 16 bytes. In such cases you will need to do it manually.

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