MCPcopy Create free account
hub / github.com/DISTORTEC/distortos / getHighWaterMark

Method getHighWaterMark

source/scheduler/Stack.cpp:118–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118size_t Stack::getHighWaterMark() const
119{
120 const auto begin =
121 static_cast<decltype(&stackSentinel)>(adjustedStorage_) + stackGuardSize / sizeof(stackSentinel);
122 const auto end = static_cast<decltype(&stackSentinel)>(adjustedStorage_) + adjustedSize_ / sizeof(stackSentinel);
123 const auto usedElement = std::find_if_not(begin, end,
124 [](decltype(stackSentinel)& element) -> bool
125 {
126 return element == stackSentinel;
127 });
128 return (end - usedElement) * sizeof(*begin);
129}
130
131int Stack::initialize(RunnableThread& runnableThread)
132{

Callers 1

getStackHighWaterMarkMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected