From f4c338c63f3456a8eccd56c35e233843687d55be Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 29 Mar 2019 00:43:25 +0800 Subject: *thread --- source/3rd-party/Luax/luax_vm.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/3rd-party/Luax/luax_vm.h (limited to 'source/3rd-party/Luax/luax_vm.h') diff --git a/source/3rd-party/Luax/luax_vm.h b/source/3rd-party/Luax/luax_vm.h new file mode 100644 index 0000000..e99d5b5 --- /dev/null +++ b/source/3rd-party/Luax/luax_vm.h @@ -0,0 +1,38 @@ +#ifndef __LUAX_CONTEXT_H__ +#define __LUAX_CONTEXT_H__ + +#include "luax_ref.h" +#include "luax_config.h" +#include "luax_state.h" + +namespace Luax +{ + + /// + /// 单个lua_state相关的context。是一系列代理的集合,拷贝也没关系,主要是为了节约内存。 + /// + class LuaxVM + { + public: + LuaxVM(lua_State* L); + ~LuaxVM(); + + void Setup(); + + LuaxState state; // lua main state + LuaxRefTable strongRefTable; // strong ref table + LuaxRefTable weakRefTable; // weak ref table + + size_t objectCount; // 统计所有在此state中创建的实例 + + private: + + void SetupRefTables(); + + int mThreadsCount; // 绑定这个context的线程数 + + }; + +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0