libcopp 2.3.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
stack_context.h
Go to the documentation of this file.
1// Copyright 2023 owent
2
3#pragma once
4
5#include <libcopp/utils/config/libcopp_build_features.h>
6
8
9// clang-format off
10#include <libcopp/utils/config/stl_include_prefix.h> // NOLINT(build/include_order)
11// clang-format on
12#include <cstddef>
13// clang-format off
14#include <libcopp/utils/config/stl_include_suffix.h> // NOLINT(build/include_order)
15// clang-format on
16
17LIBCOPP_COPP_NAMESPACE_BEGIN
18struct LIBCOPP_COPP_API stack_context {
19 size_t size;
20 void *sp;
22#ifdef LIBCOPP_MACRO_USE_SEGMENTED_STACKS
23 using segments_context_t = void *[LIBCOPP_MACRO_SEGMENTED_STACK_NUMBER];
24 segments_context_t segments_ctx;
25#endif
26
27#ifdef LIBCOPP_MACRO_USE_VALGRIND
28 unsigned valgrind_stack_id;
29#endif
30
31 stack_context() LIBCOPP_MACRO_NOEXCEPT;
32 ~stack_context() LIBCOPP_MACRO_NOEXCEPT;
33
34 stack_context(const stack_context &other) LIBCOPP_MACRO_NOEXCEPT;
35 stack_context &operator=(const stack_context &other) LIBCOPP_MACRO_NOEXCEPT;
36 stack_context(stack_context &&other) LIBCOPP_MACRO_NOEXCEPT;
37 stack_context &operator=(stack_context &&other) LIBCOPP_MACRO_NOEXCEPT;
38
39 void reset() LIBCOPP_MACRO_NOEXCEPT;
40
41 void copy_from(const stack_context &other) LIBCOPP_MACRO_NOEXCEPT;
42};
43LIBCOPP_COPP_NAMESPACE_END
void * sp
stack size