diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2019-09-30 22:14:58 +0100 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2019-09-30 22:14:58 +0100 |
commit | 78480b5f31a4848b8b31230baffb44d7e3f4d81a (patch) | |
tree | b59a75f084a24d3bc703510e6536ad4cfad10edf /src/util.rs | |
parent | 54f46271952a609444dab8718ff4770e8c76c16f (diff) | |
download | mlua-78480b5f31a4848b8b31230baffb44d7e3f4d81a.zip |
Use main state to store extra data and auxiliary registries
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs index 170e4c3..f6bdffc 100644 --- a/src/util.rs +++ b/src/util.rs @@ -442,7 +442,7 @@ pub unsafe extern "C" fn error_traceback(state: *mut ffi::lua_State) -> c_int { } // Does not call lua_checkstack, uses 1 stack space. -pub unsafe fn main_state(state: *mut ffi::lua_State) -> *mut ffi::lua_State { +pub unsafe fn get_main_state(state: *mut ffi::lua_State) -> *mut ffi::lua_State { ffi::lua_rawgeti(state, ffi::LUA_REGISTRYINDEX, ffi::LUA_RIDX_MAINTHREAD); let main_state = ffi::lua_tothread(state, -1); ffi::lua_pop(state, 1); |