diff options
Diffstat (limited to 'src/tools.h')
-rw-r--r-- | src/tools.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/tools.h b/src/tools.h index c1a8534..dce7378 100644 --- a/src/tools.h +++ b/src/tools.h | |||
@@ -1,23 +1,21 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #include "threading.h" | ||
4 | #include "deep.h" | 3 | #include "deep.h" |
5 | |||
6 | #include "macros_and_utils.h" | 4 | #include "macros_and_utils.h" |
7 | 5 | ||
8 | // forwards | 6 | // forwards |
9 | struct Universe; | 7 | class Universe; |
10 | 8 | ||
11 | // ################################################################################################ | 9 | // ################################################################################################ |
12 | 10 | ||
13 | #ifdef _DEBUG | 11 | #ifdef _DEBUG |
14 | void luaG_dump( lua_State* L); | 12 | void luaG_dump(lua_State* L); |
15 | #endif // _DEBUG | 13 | #endif // _DEBUG |
16 | 14 | ||
17 | // ################################################################################################ | 15 | // ################################################################################################ |
18 | 16 | ||
19 | void push_registry_subtable_mode( lua_State* L, UniqueKey key_, const char* mode_); | 17 | void push_registry_subtable_mode(lua_State* L, UniqueKey key_, const char* mode_); |
20 | void push_registry_subtable( lua_State* L, UniqueKey key_); | 18 | void push_registry_subtable(lua_State* L, UniqueKey key_); |
21 | 19 | ||
22 | enum class VT | 20 | enum class VT |
23 | { | 21 | { |
@@ -25,19 +23,26 @@ enum class VT | |||
25 | KEY, | 23 | KEY, |
26 | METATABLE | 24 | METATABLE |
27 | }; | 25 | }; |
28 | bool inter_copy_one(Universe* U, lua_State* L2, int L2_cache_i, lua_State* L, int i, VT vt_, LookupMode mode_, char const* upName_); | ||
29 | 26 | ||
30 | // ################################################################################################ | 27 | enum class InterCopyResult |
28 | { | ||
29 | Success, | ||
30 | NotEnoughValues, | ||
31 | Error | ||
32 | }; | ||
33 | |||
34 | [[nodiscard]] bool inter_copy_one(Universe* U, Dest L2, int L2_cache_i, Source L, int i, VT vt_, LookupMode mode_, char const* upName_); | ||
31 | 35 | ||
32 | int luaG_inter_copy_package( Universe* U, lua_State* L, lua_State* L2, int package_idx_, LookupMode mode_); | 36 | // ################################################################################################ |
33 | 37 | ||
34 | int luaG_inter_copy(Universe* U, lua_State* L, lua_State* L2, int n, LookupMode mode_); | 38 | [[nodiscard]] InterCopyResult luaG_inter_copy_package(Universe* U, Source L, Dest L2, int package_idx_, LookupMode mode_); |
35 | int luaG_inter_move(Universe* U, lua_State* L, lua_State* L2, int n, LookupMode mode_); | 39 | [[nodiscard]] InterCopyResult luaG_inter_copy(Universe* U, Source L, Dest L2, int n, LookupMode mode_); |
40 | [[nodiscard]] InterCopyResult luaG_inter_move(Universe* U, Source L, Dest L2, int n, LookupMode mode_); | ||
36 | 41 | ||
37 | int luaG_nameof( lua_State* L); | 42 | [[nodiscard]] int luaG_nameof(lua_State* L); |
38 | 43 | ||
39 | void populate_func_lookup_table( lua_State* L, int _i, char const* _name); | 44 | void populate_func_lookup_table(lua_State* L, int _i, char const* _name); |
40 | void initialize_allocator_function( Universe* U, lua_State* L); | 45 | void initialize_allocator_function(Universe* U, lua_State* L); |
41 | 46 | ||
42 | // ################################################################################################ | 47 | // ################################################################################################ |
43 | 48 | ||