From acf38245d8961125f02d4c4168053e0d83dbc6df Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 25 Dec 2021 14:38:26 +0100 Subject: refactor(lua): use references directly on main thread --- src/nvim/lua/executor.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index 6fca8e6c09..957c61f2f9 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -15,6 +15,15 @@ // Generated by msgpack-gen.lua void nlua_add_api_functions(lua_State *lstate) REAL_FATTR_NONNULL_ALL; +typedef struct { + LuaRef nil_ref; + LuaRef empty_dict_ref; + int ref_count; +#if __has_feature(address_sanitizer) + PMap(handle_T) ref_markers; +#endif +} nlua_ref_state_t; + #define set_api_error(s, err) \ do { \ Error *err_ = (err); \ @@ -35,4 +44,7 @@ void nlua_add_api_functions(lua_State *lstate) REAL_FATTR_NONNULL_ALL; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "lua/executor.h.generated.h" #endif + +EXTERN nlua_ref_state_t *nlua_global_refs INIT(= NULL); + #endif // NVIM_LUA_EXECUTOR_H -- cgit