Skip to content

Commit

Permalink
Align thread stacks on 16 byte boundaries.
Browse files Browse the repository at this point in the history
Let's align thread stacks on 16 byte boundaries so they will work fine
with SSE in the future.
  • Loading branch information
foxostro committed Jan 30, 2019
1 parent ba05212 commit c6aa783
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Common/include/common/static_stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ class StaticStack {
char* stack_pointer;

private:
alignas(alignof(void*)) char backing_[StackSize];
// Let's align thread stacks on 16 byte boundaries so they will work fine
// with SSE in the future.
static constexpr size_t ALIGNMENT = 16;

alignas(ALIGNMENT) char backing_[StackSize];
};

#endif // FLAPJACKOS_COMMON_INCLUDE_COMMON_STATIC_STACK_HPP

0 comments on commit c6aa783

Please sign in to comment.