From 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Mar 2019 23:06:27 +0800 Subject: *rename --- source/3rd-party/Luax/luax_context.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 source/3rd-party/Luax/luax_context.h (limited to 'source/3rd-party/Luax/luax_context.h') diff --git a/source/3rd-party/Luax/luax_context.h b/source/3rd-party/Luax/luax_context.h new file mode 100644 index 0000000..01c5937 --- /dev/null +++ b/source/3rd-party/Luax/luax_context.h @@ -0,0 +1,36 @@ +#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 LuaxContext + { + public: + LuaxContext(lua_State* L); + ~LuaxContext(); + + void Setup(); + + LuaxState state; // lua state + LuaxRefTable strongRefTable; // strong ref table + LuaxRefTable weakRefTable; // weak ref table + + size_t objectCount; // 统计所有在此state中创建的实例 + + private: + + void SetupRefTables(); + + }; + +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0