Shared/Base/StackAlloc.h file

Namespaces

namespace Death
Shared root namespace.

Defines

#define stack_alloc(type, size)
Allocates an array of the given type on the stack if possible.

Define documentation

#define stack_alloc(type, size)

Allocates an array of the given type on the stack if possible.

If size is greater than 4024 bytes, the standard heap allocation is used. Otherwise, the stack allocation is used, which must be used with caution as there is no check on how much space is left in the stack. Using the following syntax is recommended, as the type itself is an implementation detail:

auto array = stack_alloc(std::int32_t, 1024);
array[0] = ;