aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-02-27 09:41:02 +0100
committerGitHub <noreply@github.com>2022-02-27 09:41:02 +0100
commit7dd2b0b79a34a7b3560971bc7c1466621134e469 (patch)
tree462102a3f1ac25fd0c9a145d7f2aa135999fc543 /src/nvim/lua/executor.h
parent8bf3a3e303dbefa47653964dd027074e804b418c (diff)
parent850b3e19c9fc8d84d960e6932a9ad4f0bcad2a8e (diff)
downloadrneovim-7dd2b0b79a34a7b3560971bc7c1466621134e469.tar.gz
rneovim-7dd2b0b79a34a7b3560971bc7c1466621134e469.tar.bz2
rneovim-7dd2b0b79a34a7b3560971bc7c1466621134e469.zip
Merge pull request #17386 from bfredl/neothread
support threads in lua
Diffstat (limited to 'src/nvim/lua/executor.h')
-rw-r--r--src/nvim/lua/executor.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h
index bf78f7ec5e..957c61f2f9 100644
--- a/src/nvim/lua/executor.h
+++ b/src/nvim/lua/executor.h
@@ -4,6 +4,7 @@
#include <lauxlib.h>
#include <lua.h>
+#include "nvim/assert.h"
#include "nvim/api/private/defs.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h"
@@ -14,10 +15,14 @@
// Generated by msgpack-gen.lua
void nlua_add_api_functions(lua_State *lstate) REAL_FATTR_NONNULL_ALL;
-EXTERN LuaRef nlua_nil_ref INIT(= LUA_NOREF);
-EXTERN LuaRef nlua_empty_dict_ref INIT(= LUA_NOREF);
-
-EXTERN int nlua_refcount INIT(= 0);
+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 { \
@@ -39,4 +44,7 @@ EXTERN int nlua_refcount INIT(= 0);
#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