#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_type & | operator= (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 |
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.