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_buffer_allocator< Size, Alignment > 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_buffer_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
 
pointer allocate (size_type byteSize, size_type alignment, int flags=0)
 
AZ_FORCE_INLINE void deallocate (pointer ptr, size_type byteSize=0, size_type alignment=0)
 
AZ_FORCE_INLINE size_type resize (pointer ptr, size_type newSize)
 
AZ_FORCE_INLINE void reset ()
 
AZ_FORCE_INLINE bool inrange (void *address) const
 

Detailed Description

template<AZStd::size_t Size, AZStd::size_t Alignment>
class AZStd::static_buffer_allocator< Size, Alignment >

This allocator uses aligned_storage to declare a static buffer, which is used for all allocations. This allocator is designed to be used as a temporary allocator on the stack. It just allocates from the buffer never frees anything, until you call reset. It does allow memory leaks, thus allowing containers never to call deallocate, which makes them faster.


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