diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-12-21 14:58:50 -0800 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-12-21 15:00:35 -0800 |
commit | 4164be7206d740b77b5a7b4b2f859ed122d08c10 (patch) | |
tree | 36221f6baeca0eea6e416ad95a6420a093892a03 /lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h | |
parent | ceb433ad162bac35888303d29d34dc2609974d92 (diff) | |
download | llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.zip llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.tar.gz llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.tar.bz2 |
[Lldb/Lua] Persist Lua state across script interpreter calls.
Don't create a new lua state on every operation. Share a single state
across the lifetime of the script interpreter. Add simple locking to
prevent two threads from modifying the state concurrently.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h index 7f69a73..b34c7d0 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h +++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h @@ -12,7 +12,7 @@ #include "lldb/Interpreter/ScriptInterpreter.h" namespace lldb_private { - +class Lua; class ScriptInterpreterLua : public ScriptInterpreter { public: ScriptInterpreterLua(Debugger &debugger); @@ -40,6 +40,11 @@ public: lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; + + Lua &GetLua(); + +private: + std::unique_ptr<Lua> m_lua; }; } // namespace lldb_private |