template <typename T, size_t N>

class StackAllocator

Defined at line 22 of file ../../src/ui/lib/escher/util/stack_allocator.h

A simple, fast allocator that allocates from a fixed-size region within

itself. It can return either pointers to uninitialized memory, or memory

filled with a specified value. Resetting the allocator for reuse is

extremely fast: the amount of used memory is simply set to zero. No

destructors are called when the allocator is reset/destroyed; for safety,

only trivially-destructible types can be allocated.

Public Methods

void StackAllocator<T, N> ()

Defined at line 24 of file ../../src/ui/lib/escher/util/stack_allocator.h

T * Allocate (size_t count)

Return a pointer to the specified number of T objects. Return nullptr if

the requested number is zero, or if there is not enough space available.

The contents of the pointed-to memory are undefined.

Defined at line 29 of file ../../src/ui/lib/escher/util/stack_allocator.h

T * AllocateFilled (size_t count, const T & fill_value)

Return a pointer to the specified number of T objects. Return nullptr if

the requested number is zero, or if there is not enough space available.

Each T item in the pointed-to memory is initialized to the specified value,

or a default value if none is specified.

Defined at line 46 of file ../../src/ui/lib/escher/util/stack_allocator.h

void Reset ()

Reset the allocator so that its memory can be reallocated. Any pointers

previously obtained from Allocate() and AllocateFilled() are now invalid,

and should not be used.

Defined at line 57 of file ../../src/ui/lib/escher/util/stack_allocator.h