summaryrefslogtreecommitdiff
path: root/src/function.rs
AgeCommit message (Collapse)Author
2020-12-31Update documentationAlex Orlenko
2020-07-27Add Function::dump() to dump lua function to a binary chunkAlex Orlenko
2020-05-15Update documentationAlex Orlenko
2020-04-20Update documentationAlex Orlenko
2020-04-19Minor refactorAlex Orlenko
2020-04-18Add family of `call_async` functionAlex Orlenko
Update documentation Move async tests to a separate file
2020-01-07Implement PartialEq trait for Value (and subtypes)Alex Orlenko
Add equals() method to compare values optionally invoking __eq.
2019-11-04Fix examples and docsAlex Orlenko
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-19Small renames and comments to better communicate the intention of stack ↵kyren
checking functions
2018-03-19Where possible, don't call to_lua / from_lua / to_lua_multi / from_lua_multi ↵kyren
callbacks during Lua stack manipulation This should protect against being able to trigger a stack assert in Lua. Lua and associated types shoul be able to assume that LUA_MINSTACK stack slots are available on any user entry point. In the future, we could turn check_stack into something that only checked the Lua stack when debug_assertions is true.
2018-03-12Remove `stack_guard` function and instead just use StackGuard directlykyren
2018-03-11A lot of performance changes.kyren
Okay, so this is kind of a mega-commit of a lot of performance related changes to rlua, some of which are pretty complicated. There are some small improvements here and there, but most of the benefits of this change are from a few big changes. The simplest big change is that there is now `protect_lua` as well as `protect_lua_call`, which allows skipping a lightuserdata parameter and some stack manipulation in some cases. Second simplest is the change to use Vec instead of VecDeque for MultiValue, and to have MultiValue be used as a sort of "backwards-only" Vec so that ToLuaMulti / FromLuaMulti still work correctly. The most complex change, though, is a change to the way LuaRef works, so that LuaRef can optionally point into the Lua stack instead of only registry values. At state creation a set number of stack slots is reserved for the first N LuaRef types (currently 16), and space for these are also allocated separately allocated at callback time. There is a huge breaking change here, which is that now any LuaRef types MUST only be used with the Lua on which they were created, and CANNOT be used with any other Lua callback instance. This mostly will affect people using LuaRef types from inside a scope callback, but hopefully in those cases `Function::bind` will be a suitable replacement. On the plus side, the rules for LuaRef types are easier to state now. There is probably more easy-ish perf on the table here, but here's the preliminary results, based on my very limited benchmarks: create table time: [314.13 ns 315.71 ns 317.44 ns] change: [-36.154% -35.670% -35.205%] (p = 0.00 < 0.05) create array 10 time: [2.9731 us 2.9816 us 2.9901 us] change: [-16.996% -16.600% -16.196%] (p = 0.00 < 0.05) Performance has improved. create string table 10 time: [5.6904 us 5.7164 us 5.7411 us] change: [-53.536% -53.309% -53.079%] (p = 0.00 < 0.05) Performance has improved. call add function 3 10 time: [5.1134 us 5.1222 us 5.1320 us] change: [-4.1095% -3.6910% -3.1781%] (p = 0.00 < 0.05) Performance has improved. call callback add 2 10 time: [5.4408 us 5.4480 us 5.4560 us] change: [-6.4203% -5.7780% -5.0013%] (p = 0.00 < 0.05) Performance has improved. call callback append 10 time: [9.8243 us 9.8410 us 9.8586 us] change: [-26.937% -26.702% -26.469%] (p = 0.00 < 0.05) Performance has improved. create registry 10 time: [3.7005 us 3.7089 us 3.7174 us] change: [-8.4965% -8.1042% -7.6926%] (p = 0.00 < 0.05) Performance has improved. I think that a lot of these benchmarks are too "easy", and most API usage is going to be more like the 'create string table 10' benchmark, where there are a lot of handles and tables and strings, so I think that 25%-50% improvement is a good guess for most use cases.
2018-03-08Simplify stack_guard / stack_err_guardkyren
The expected change is always zero, because stack_guard / stack_err_guard are always used at `rlua` entry / exit points.
2018-02-19Remove terrible awful no-good evil hackkyren
The breakage is being addressed in rust itself.
2018-02-19Cleanup max upvalues constant a bit, add some luaconf.h assumptionskyren
2018-02-18Fix several bugs found while doing C conversionkyren
Fixing these in master in case I need to back out the change I'm making
2018-02-16Can.. can I do this? Is this a thing that actually works?kyren
Drastic times and all that.
2018-02-15Provisional "fix" for #71. Requires nightly :(kyren
2018-02-12Some changes for panic correctness, stack usage correctness, and speedkyren
2018-02-09Move all tests into a tests/ subfolderkyren
2018-02-09Error correctly on too many arguments / returns / binds / recursionskyren
There are also some other drive-by changes to fix panicking in extern "C" functions and other edge case stack errors
2017-12-04more reorganization in an attempt to shrink the size of lua.rskyren
2017-12-04Move function and thread into their own modules, auto-formattingkyren