Commit Graph

  • 8d474bbf8d Fix clippy warning Alex Orlenko 2021-06-21 03:25:21 +01:00
  • 9e3b0ecc1e Even better optimization after 14d5c2c887 Alex Orlenko 2021-06-20 19:48:33 +01:00
  • 42b396d0d1 Optimize non-wrapped userdata method calls Alex Orlenko 2021-06-20 12:38:47 +01:00
  • 14d5c2c887 Lua->Rust callback performance improvements Alex Orlenko 2021-06-20 00:24:53 +01:00
  • b84c10fde6 Update README (include publishing to luarocks section) Alex Orlenko 2021-06-19 14:56:49 +01:00
  • b49f9539b6 Update CHANGELOG Alex Orlenko 2021-06-19 14:42:58 +01:00
  • a208156ed2 Update examples to include chunk! macro Alex Orlenko 2021-06-19 14:41:48 +01:00
  • 242bdafa75 More tests for arc/rc wrapped userdata Alex Orlenko 2021-06-19 00:03:09 +01:00
  • b84d1bd65f Update test names Alex Orlenko 2021-06-18 23:13:56 +01:00
  • 4e92ea341b Fix userdata memleak in edge case. This can happen if we unable to push metatable with __gc metamethod after pushing userdata. In this case Lua will never execute drop. Instead, we will push metatable first and then userdata. Alex Orlenko 2021-06-18 17:45:20 +01:00
  • bf286751fa Improve code coverage Alex Orlenko 2021-06-17 00:11:58 +01:00
  • 3b94b4e86f Implement Hash for RegistryKey. Closes #57 Alex Orlenko 2021-06-16 12:12:42 +01:00
  • 9f0378b77e Complitely remove the C shim Alex Orlenko 2021-06-16 22:21:45 +01:00
  • d3f44354e0 Revert commit ced808d5ab I think this experiment is unsuccessful and does not work well in a module mode with dynamic symbols resolution and mixing between different mlua instances. Overall the Rust bug has been fixed and we can wait for the "C-unwind" feature become stable. Alex Orlenko 2021-06-16 22:13:11 +01:00
  • fca21d56d3 Check stack in entrypoint1 before pushing value to a stack Alex Orlenko 2021-06-13 23:28:41 +01:00
  • 6e52bb7e65 Fix clippy warnings && tests Alex Orlenko 2021-06-13 23:08:56 +01:00
  • 08ffeb0ca9 Improve module mode: - Don't hide module function inside luaopen_% function. - Raise Lua exception instead of panic if module function returns error. Alex Orlenko 2021-06-13 22:38:51 +01:00
  • 3b9d8a7b5f Keep all Lua symbols in unsafe mode to load C modules Alex Orlenko 2021-06-12 18:00:55 +01:00
  • 0fe898c0dd v0.6.0-beta.3 v0.6.0-beta.3 Alex Orlenko 2021-06-04 12:38:09 +01:00
  • 821f1125b6 Add String::to_string_lossy Alex Orlenko 2021-06-04 00:16:40 +01:00
  • 6c0096d8ac Update examples Alex Orlenko 2021-06-03 23:52:29 +01:00
  • abb95c3c56 Remove T: Clone requirement from add_async_function Alex Orlenko 2021-06-03 23:21:00 +01:00
  • 64faebf407 Add __ipairs metamethod (again) for Lua 5.2 only Alex Orlenko 2021-06-03 18:43:29 +01:00
  • a944f4ad6f Implement UserData for Rc<RefCell>/Arc<Mutex>/Arc<RwLock> wrappers Alex Orlenko 2021-05-31 23:33:44 +01:00
  • bae424672a Treat errors as Send + Sync to be compatible with anyhow crate Alex Orlenko 2021-05-31 11:05:41 +01:00
  • 6f9eb82649 Update README Alex Orlenko 2021-05-18 20:13:28 +01:00
  • e8de2a458a Allow multiple entrypoints in a single module share the same Lua state. Previously it would initialize different Lua instances. Fixes #49. Alex Orlenko 2021-05-18 20:07:34 +01:00
  • 973b5c3bf5 v0.6.0-beta.2 v0.6.0-beta.2 Alex Orlenko 2021-05-13 22:17:15 +01:00
  • b610a79d66 Update docs & minor error handling code changes Alex Orlenko 2021-05-11 14:18:22 +01:00
  • fe39ae09bf Try different approach for errors handling. Instead of convering error to CallbackError in error message handler, do it earlier at callback_error stage. Better fix for #44. Alex Orlenko 2021-05-11 00:53:07 +01:00
  • 01714d2510 Prepare 0.6.0-beta.2 release Alex Orlenko 2021-05-10 22:28:33 +01:00
  • 0bad4a0ff9 Fix spelling Alex Orlenko 2021-05-10 19:53:38 +01:00
  • 35b7504076 Improve error reporting in module mode. Attach traceback to a WrappedError. Fixes #44. Alex Orlenko 2021-05-09 21:39:28 +01:00
  • c9b8eb5418 Re-export UserDataFields/UserDataMetatable Alex Orlenko 2021-05-09 09:30:33 +01:00
  • ef7d123f80 Exclude mlua_derive from coverage report Alex Orlenko 2021-05-06 00:41:20 +01:00
  • 20cba5de5b Fix clippy warnings Alex Orlenko 2021-05-06 00:36:47 +01:00
  • 3e03f4201c Add chunk! macro support Alex Orlenko 2021-05-05 21:55:49 +01:00
  • 5199b02346 Update lua state when polling futures Alex Orlenko 2021-05-05 12:37:27 +01:00
  • 5293b8d6d2 Add Thread::reset() for luajit/lua54 Alex Orlenko 2021-05-05 11:11:32 +01:00
  • 7541b6f3f3 Remove deprecated AnyUserData::has_metamethod() Alex Orlenko 2021-05-04 23:57:47 +01:00
  • 205510a540 Update sys align code Alex Orlenko 2021-05-04 23:55:24 +01:00
  • 2250421438 Fix clippy warnings Alex Orlenko 2021-05-04 23:42:33 +01:00
  • 8e57e6fa5a v0.6.0-beta.1 v0.6.0-beta.1 Alex Orlenko 2021-05-04 00:43:26 +01:00
  • f2dbbb091f Update dependencies Alex Orlenko 2021-05-04 00:31:51 +01:00
  • 13cfb4bd51 Add CHANGELOG for v0.6.0-beta.1 Alex Orlenko 2021-05-03 23:36:18 +01:00
  • 33ebacab49 Update README Alex Orlenko 2021-05-03 22:17:40 +01:00
  • 3829b72212 Update code docs Alex Orlenko 2021-05-03 22:17:34 +01:00
  • af67971e0d Make SerializeOptions non_exhaustive. Add builder implementation similar to LuaOptions to set individual options. Alex Orlenko 2021-05-03 21:43:56 +01:00
  • 0f4bcca7ce Add LuaOptions to customize Lua/Rust behaviour. The only option is catch_rust_panics to optionally disable catching Rust panics via pcall/xpcall. Alex Orlenko 2021-05-03 21:16:42 +01:00
  • 585c0a25d8 Replace 'Thread already finished' error with common Error::CoroutineInactive Alex Orlenko 2021-05-03 13:11:59 +01:00
  • 64346ce56c Implement/Derive Debug for Lua and few other structs Alex Orlenko 2021-05-03 13:05:43 +01:00
  • 108682cc71 Store safe property in Extra state to inherit into Lua structs made from pointers Alex Orlenko 2021-05-03 12:40:14 +01:00
  • 4af7bcf0d9 Implement ToLua/FromLua for Box<str> and Box<[T]> Alex Orlenko 2021-05-03 01:15:36 +01:00
  • 1bb3c5c19f Fix typo in README Alex Orlenko 2021-05-02 23:53:48 +01:00
  • a4567cb5f7 Improve growing the auxiliary stack of the ref thread: Try to double size first, if not fulfilled try halving in a loop till 0. Fix unwinding after panic in ref_stack_pop. Add test to check the stack exhaustion. Alex Orlenko 2021-05-02 23:26:02 +01:00
  • 26d8d899f2 Allocate Waker slot in Registry in re-use it (instead of creating new userdata for it) Alex Orlenko 2021-05-02 13:04:02 +01:00
  • 67bc0b1196 Make AsyncPollPending internal value as LightUserData Alex Orlenko 2021-05-02 12:06:32 +01:00
  • e8505b5239 Change signature of Function::dump() to remove Result Alex Orlenko 2021-05-02 11:48:42 +01:00
  • 3f55958bdd Stack assertions review Other minor code and documentation updates Alex Orlenko 2021-05-02 10:38:33 +01:00
  • 463fc646bc Refactor UserDataCell Alex Orlenko 2021-04-27 18:31:57 +01:00
  • b5f1325f2f Store nonstatic UserData pointer in self userdata (instead of metatable) Alex Orlenko 2021-04-27 12:58:25 +01:00
  • 0625991a48 Update github action to fix modules test on Windows (lua53 -> lua54) Alex Orlenko 2021-04-27 10:38:20 +01:00
  • 269ef9c55d Fix lua51 scope compilation Alex Orlenko 2021-04-27 10:11:37 +01:00
  • f5b88624ce Hide Deserializer inner fields Improve documentation Alex Orlenko 2021-04-27 10:04:18 +01:00
  • 2fae94586d Remove Result from lua.null() and lua.array_metatable(). They never fail. Alex Orlenko 2021-04-27 00:29:24 +01:00
  • bc81d1016f Add SerializeOptions to to change default Lua serializer behaviour Alex Orlenko 2021-04-27 00:21:49 +01:00
  • c19f12898d Replace lazy_static with once_cell Alex Orlenko 2021-04-11 15:23:43 +01:00
  • c7541ef7d3 More tests Alex Orlenko 2021-04-11 13:19:12 +01:00
  • 41a1a0d15a Add more checks for destructed userdata in AnyUserData Alex Orlenko 2021-04-11 00:07:04 +01:00
  • c10169a380 cargo fmt and other minor fixes Alex Orlenko 2021-04-10 23:48:47 +01:00
  • ced808d5ab Don't trigger longjmp in rust. Motivation behind this change is upcoming breaking change in Rust compiler v1.52.0 to prevent unwinding across FFI boundaries. https://github.com/rust-lang/rust/pull/76570 The new functionality requires nightly compiler to declare FFI functions as "C-unwind". The fundamental solution is to use C shim to wrap "e" and "m" Lua functions in pcall. Additionally define Rust calling convention to trigger lua_error on Rust behalf. Alex Orlenko 2021-04-09 12:05:03 +01:00
  • c95ac32741 Add inline(always) to some compat53 functions Alex Orlenko 2021-03-30 13:19:14 +01:00
  • 14169eadb1 Include nightly to github CI tests Alex Orlenko 2021-03-30 11:50:09 +01:00
  • 5a7ad9f7cd Fix some clippy warnings & minor changes Alex Orlenko 2021-03-13 20:01:25 +00:00
  • decb5b9e37 Make MetaMethod::name() public Tests for UserDataMetatable::pairs() Alex Orlenko 2021-02-20 22:42:09 +00:00
  • 1635903d3f Improve/fix scoped UserData drop Alex Orlenko 2021-02-20 01:02:35 +00:00
  • 2b2df708f9 Add UserDataFields API. Provide safe access to UserData metatable and allow to define custom metamethods.. Alex Orlenko 2021-02-19 11:48:56 +00:00
  • cb1ac28f2a v0.5.4 v0.5.4 Alex Orlenko 2021-04-18 22:52:24 +01:00
  • 3e7f25670a Don't read lua.h from build script (was not used) Alex Orlenko 2021-04-20 02:05:00 +01:00
  • 0d404ce4c3 Don't fail CI on coverage Alex Orlenko 2021-04-16 22:43:21 +01:00
  • e26cec5db9 Drop 'feature(link_args)' (removed from nightly). Don't run tests for LuaJIT 2.0.5 Alex Orlenko 2021-04-16 22:26:37 +01:00
  • 0bd36b42e7 Make error::Error non_exhaustive Alex Orlenko 2021-04-11 14:21:20 +01:00
  • e0da6ac929 Hide raw_sequence_values_by_len under async/serialize feature flags Alex Orlenko 2021-03-27 09:59:24 +00:00
  • 0c7db4916c Serialize only known (registered) userdata. This reverts commit 7332c6a. Non-static userdata is a special case and can cause segfault if try to serialize it. Now it should be safe, plus I added non-static userdata destructor to generate better error messages in case of accessing destructed userdata. Alex Orlenko 2021-04-16 22:01:55 +01:00
  • b9589491e4 Improve panic handling (check for twice resumed panics) Alex Orlenko 2021-04-15 23:04:36 +01:00
  • 58cb371f06 Add rerun-if-changed instructions to build script Alex Orlenko 2021-04-14 22:33:14 +01:00
  • 8add60b019 Don't check LUA_LIB_NAME if it's not needed Alex Orlenko 2021-04-14 22:25:36 +01:00
  • c363fb9288 v0.5.3 v0.5.3 Alex Orlenko 2021-03-04 00:01:06 +00:00
  • 3900e23839 Fix compilation warnings on nightly Alex Orlenko 2021-03-03 23:36:28 +00:00
  • 726fde7e1f Optimise async callbacks (polling) Alex Orlenko 2021-03-03 23:21:56 +00:00
  • 7cb9c4f39c Fix bug in returning nil-prefixed multi values from async function Alex Orlenko 2021-03-03 22:32:22 +00:00
  • b93ace0224 v0.5.2 v0.5.2 Alex Orlenko 2021-02-27 19:32:25 +00:00
  • 5f37bf812d Fix/whitelist some clippy warnings Alex Orlenko 2021-02-27 19:23:08 +00:00
  • 1f7e760d20 Add codecov coverage report Alex Orlenko 2021-02-27 17:40:14 +00:00
  • 90bea4aa34 Update README and keywords Alex Orlenko 2021-02-27 13:22:42 +00:00
  • 7775b4a99c Bump copyright year Alex Orlenko 2021-02-26 10:35:00 +00:00
  • 1d9cda10eb Add ToLua implementation for Cow<str> and Cow<CStr> Alex Orlenko 2021-02-26 10:23:36 +00:00
  • 7332c6a28c Remove registered_userdata_mt check Alex Orlenko 2021-02-22 20:38:36 +00:00
  • 94670e3fdb rustfmt Alex Orlenko 2021-02-22 20:13:56 +00:00
  • 335f433df4 Optimize callbacks Alex Orlenko 2021-02-21 23:51:49 +00:00