nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
stack_guard.hpp
1#pragma once
2
3#include <cstddef>
4#include <string>
5
6namespace nk {
7
8class StackGuard
9{
10public:
11 static constexpr size_t SAFETY_MARGIN_BYTES = 64 * 1024; // 64 KB
12
13 static void check(const char *stage = nullptr);
14
15 explicit StackGuard(const char *stage = nullptr)
16 {
17 check(stage);
18 }
19};
20
21} // namespace nk