template<size_t kStackSizeBytes>
class pw::ThreadStack< kStackSizeBytes >
Declares a stack to use with a ThreadContext<>
without an integrated stack.
Allocating stacks alongside the ThreadContext
(e.g. with ThreadContext<1024>
) is simpler, but more limited. Declaring a ThreadStack
separately gives you more control. For example, you can:
- Declare thread stacks at specific addresses (e.g. with
PW_PLACE_IN_SECTION
.)
- Specify larger-than-native alignments (e.g.
alignas(256) pw::ThreadStack<1024>
).
- Poison memory immediately before/after the stack to help detect overflow.