File tree Expand file tree Collapse file tree 2 files changed +23
-21
lines changed Expand file tree Collapse file tree 2 files changed +23
-21
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,28 @@ constexpr ExecutionResult Void{true};
41
41
// / Shortcut for execution that resulted in a trap.
42
42
constexpr ExecutionResult Trap{false };
43
43
44
+
45
+ class ThreadContext
46
+ {
47
+ class [[nodiscard]] Guard
48
+ {
49
+ ThreadContext& m_thread_context;
50
+
51
+ public:
52
+ explicit Guard (ThreadContext& ctx) noexcept : m_thread_context{ctx} {}
53
+ ~Guard () noexcept { --m_thread_context.depth ; }
54
+ };
55
+
56
+ public:
57
+ int depth = 0 ;
58
+
59
+ Guard bump_call_depth () noexcept
60
+ {
61
+ ++depth;
62
+ return Guard{*this };
63
+ }
64
+ };
65
+
44
66
// / Execute a function from an instance.
45
67
// /
46
68
// / @param instance The instance.
Original file line number Diff line number Diff line change @@ -20,27 +20,7 @@ namespace fizzy
20
20
{
21
21
struct ExecutionResult ;
22
22
struct Instance ;
23
-
24
- class ThreadContext
25
- {
26
- class [[nodiscard]] Guard
27
- {
28
- ThreadContext& m_thread_context;
29
-
30
- public:
31
- explicit Guard (ThreadContext& ctx) noexcept : m_thread_context{ctx} {}
32
- ~Guard () noexcept { --m_thread_context.depth ; }
33
- };
34
-
35
- public:
36
- int depth = 0 ;
37
-
38
- Guard bump_call_depth () noexcept
39
- {
40
- ++depth;
41
- return Guard{*this };
42
- }
43
- };
23
+ class ThreadContext ;
44
24
45
25
// / Function representing WebAssembly or host function execution.
46
26
using execute_function = std::function<ExecutionResult(Instance&, const Value*, ThreadContext&)>;
You can’t perform that action at this time.
0 commit comments