summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-07Don't keep the unref list around forever after Lua is droppedkyren
2018-02-06Lots of changes, not sure if actually safe yet.kyren
* Make Lua Send * Add Send bounds to (nearly) all instances where userdata and functions are passed to Lua * Add a "scope" method which takes a callback that accepts a `Scope`, and give `Scope` the ability to create functions and userdata that are !Send, *and also functions that are not even 'static!*.
2018-02-06fix missing unwrap in testskyren
2018-02-06Don't panic on mismatched `RegistryKey` use, instead return errorkyren
2018-02-06Slightly different strategy with RegistryKey valueskyren
Provide a method for automatic cleanup of expired RegistryKey values, so that manually cleaning up registry values is optional.
2018-02-06test `owns_registry_value`kyren
2018-02-06Add method to check whether a RegistryKey is owned by a given `Lua` instancekyren
2018-02-06experimentally make `RegistryKey` Sendkyren
2018-02-05Set the metatable of __gc'ed userdata to something more informativekyren
2018-01-27Use ptr::write to initialize uninitalized memory, NOT mem::replacekyren
2018-01-27Simplify handling of userdata __gc and resurrected userdata.kyren
Now, simply remove the userdata table immediately before dropping the userdata. This does two things, it prevents __gc from double dropping the userdata, and after the first call to __gc, it prevents the userdata from being identified as any particular userdata type, so it cannot be misused after being finalized. This change thus removes the userdata invalidation error, and simplifies a lot of userdata handling code. It also fixes a panic bug. Because there is no predictable order for finalizers, it is possible to run a userdata finalizer that does not resurrect itself before a lua table finalizer that accesses that userdata, and this means that there were several asserts that were possible to trigger in normal Lua code in util.rs related to `WrappedError`. Now, finalized userdata is simply a userdata with no methods, so any use of finalized userdata becomes a normal script runtime error (though, with a potentially confusing error message). As a future improvement, we could set a metatable on finalized userdata that provides a better error message.
2018-01-26Bump cargo version to 0.11.0kyren
2018-01-26update changelog for 0.11.0kyren
2018-01-26Update README for clarity, typofixeskyren
2018-01-26Add an API that exposes the functionality of `lua_getuservalue` and ↵kyren
`lua_setuservalue`
2018-01-26ACTUALLY expose `RegistryKey` APIkyren
Also fixes a safety issue with RegistryKey, where you could use RegistryKeys with mismatching Lua instances.
2018-01-26Merge pull request #66 from jonas-schievink/docskyren
Clarify a few docs
2018-01-26__gc would be safe now, reword MetaMethod docs accordinglyJonas Schievink
2018-01-26Additional `MetaMethod` docsJonas Schievink
2018-01-26create_function docs: mention what returning `Err` doesJonas Schievink
2018-01-26Fix rustdoc rendering warningJonas Schievink
2018-01-26Don't use a `StdResult` alias for better docs.Jonas Schievink
This is a pretty opinionated change, but I find documentation to be clearer when using plain old names everybody understands immediately.
2018-01-24Merge pull request #63 from chucklefish/failurekyren
Experimentally use the `failure` crate for errors
2018-01-21Experimentally use the `failure` crate for errorskyren
2017-12-17Missed unprotected call to luaL_refkyren
2017-12-17Update README, CHANGELOG, and Cargo.toml for 0.10.2kyren
2017-12-17Add automatic Lua "user accessible registry" keyskyren
Also, during the implementation of this, I noticed a problem with the 0.10 memory safety, which is that luaL_ref is also memory unsafe. I attempted to change the API to support luaL_ref potentially returning Result, but this change will cause an enormous amount of API chaos, (just as an example, it becomes impossible to implement Clone for LuaRef as is). Instead, luaL_ref now is guarded by gc_guard.
2017-12-16Change API names, add unset functionkyren
2017-12-16auto formattingkyren
2017-12-16API for registry access via string keys only (for now)kyren
Also includes some fixes for stack usage and changes an assert_eq to lua_assert
2017-12-05spelling fix for my spelling fixkyren
2017-12-05bump version for doc spelling fixkyren
2017-12-05spelling fixeskyren
2017-12-04extra spacekyren
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-04Couple of changes:kyren
- Update readme, changelog, cargo version number in preparation for release - Remove panicking behavior on recursive callback calls, add additional error variant for recursive callback 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
2017-12-04Include garbage collector error type, remove unnecessary setmetatable wrapperkyren
2017-12-04I *THINK* this might actually be it, is rlua 'm' safe now?kyren
2017-12-03I believe this is all the external API changes necessary for 'm' safetykyren
2017-12-03missing push_string calls in utilkyren
2017-12-03Couple of changes in preparation for 'm' safety:kyren
- auto formatting - add gc control to ffi - add gc_guard to util functions - use gc_guard to make util error handling functions never trigger __gc metamethod Lua errors even without __gc metatable wrapper - sort of a technicality, don't call luaL_requiref outside of the Lua constructor, as it could trigger the garbage collector when user code has had a chance to set __gc metamethods. Changes the API to load the debug table.
2017-12-03more refactoringkyren
2017-12-03remove specific protected functions in favor of generic protect_lua_callkyren
2017-12-03missed stack size fixkyren
2017-12-03More refactoring towards mem error safetykyren
2017-12-03auto formattingkyren
2017-12-03more refactoring trying to find a workable path to 'm' error safetykyren
2017-12-02still making small structural changeskyren
slowly trying to refactor things until using all the protected calls in protected_ffi is workable