summaryrefslogtreecommitdiff
path: root/src/macros.rs
AgeCommit message (Collapse)Author
2021-09-28Change syntax of `protect_lua` macroAlex Orlenko
2021-09-28Make `protect_lua` as a smart macro to choose from C/closureAlex Orlenko
2021-08-22Fix clippy warningsAlex Orlenko
2021-07-08Revert "Make `protect_lua` as a smart macro to choose from C/closure"Alex Orlenko
This reverts commit 84fe5f7f761e5a9669ae00df3f6e48ef2814272c.
2021-07-07Make `protect_lua` as a smart macro to choose from C/closureAlex Orlenko
2020-06-07New `module` featureAlex Orlenko
Don't link module with Lua core (see: http://lua-users.org/wiki/BuildingModules) Example and tests for modules
2019-10-01Rename to mluaAlex Orlenko
2019-09-29Backport changes from rlua 0.16 (master branch)Alex Orlenko
2018-08-05format with up-to-date rustfmtkyren
2018-03-12Move several asserts to only be active with debug, bump alpha version numberkyren
2018-03-08Change strategies for handling the Lua stack during panicskyren
Previously, on an internal panic, the Lua stack would be reset before panicking in an attempt to make sure that such panics would not cause stack leaks or leave the stack in an unknown state. Now, such panic handling is done in stack_guard and stack_err_guard instead, and this is for a few reasons: 1) The previous approach did NOT handle user triggered panics that were outside of `rlua`, such as a panic in a ToLua / FromLua implementation. This is especially bad since most other panics would be indicative of an internal bug anyway, so the utility of keeping `rlua` types usable after such panics was questionable. It is much more sensible to ensure that `rlua` types are usable after *user generated* panics. 2) Every entry point into `rlua` should be guarded by a stack_guard or stack_err_guard anyway, so this should restore the Lua stack on exiting back to user code in all cases. 3) The method of stack restoration no longer *clears* the stack, only resets it to what it previously was. This allows us, potentially, to keep values at the beginning of the Lua stack long term and know that panics will not clobber them. There may be a way of dramatically speeding up ref types by using a small static area at the beginning of the stack instead of only the registry, so this may be important.
2018-02-28Add debug API to ffi (not used yet, was using experimentally)kyren
Also fix for cstr! macro
2018-02-10lua_abort / lua_internal_abort macroskyren
2018-02-07Don't panic with "rlua internal error" message on panics that are not internalkyren
It is part of the contract that only LuaRef types constructed from the same parent Lua state are passed into Lua, so generating a panic there is not an internal error.
2017-12-04Add `ExpiredUserData` error and avoid what was previously a panickyren
Also make sure that panic messages clearly state that they are internal errors, so people report them as a bug. Since the only panics left are all internal errors, just move the internal error message into the panic / assert macros.
2017-12-02auto-formattingkyren
2017-12-02split macros into their own filekyren
2017-06-14Remove src/macros.rsJonas Schievink
It's not used by anything. It's not even included via `mod macros;`.
2017-05-21Initial importkyren