diff --git a/emper/Context.hpp b/emper/Context.hpp index 210b1ec340030fa3529981dc9d693be3688c9e86..99485fe67688eafbae0d0e63a1a044ea570714db 100644 --- a/emper/Context.hpp +++ b/emper/Context.hpp @@ -18,14 +18,14 @@ extern "C" [[noreturn]] void switch_and_load_context(void** toTos); extern "C" void save_and_switch_context(void** toTos, void** fromTos); extern "C" [[noreturn]] void switch_context(void** toTos); -class Context : Logger<LogSubsystem::C> { +class ALIGN_TO_CACHE_LINE Context : Logger<LogSubsystem::C> { private: static const unsigned int CONTEXT_SIZE = 0xffff; // 1024 * 1024 * 4; static thread_local Context* currentContext; - char context[CONTEXT_SIZE]; void* const tos; + // unsigned valgrindStackId; void* savedStackpointer; @@ -35,6 +35,10 @@ private: func_t preMainHook; + // Allign the stack to a cache line, so that it isn't shared with + // the other members of this class. + ALIGN_TO_CACHE_LINE char context[CONTEXT_SIZE]; + friend std::ostream& operator<<(std::ostream&, const Context&); /**