Commit Graph

  • 4fff14a144 impl Drop for MultiValue This action would automatically return container to the pool on drop (instead of doing it manually) Alex Orlenko 2023-08-01 11:08:22 +01:00
  • 196c09a0d6 New (unsafe and private) methods for IntoLua/FromLua traits: push_into_stack/from_stack. They allow to push Value directly to Lua stack or get Value from Lua stack without creating MultiValue container. This approach is a big optimization opportunity and already demonstrated great results. For instance, obtaining &T for userdata methods are now work directly from stack value without copying to auxiliary stack. Alex Orlenko 2023-07-31 21:25:56 +01:00
  • 114f072269 Update module entrypoint function. Return c_int instead of Result (and avoid potential panic on Rust side). Alex Orlenko 2023-07-31 17:33:20 +01:00
  • b3211f13ee Minor fixes in v0.9 release notes Alex Orlenko 2023-07-31 10:17:40 +01:00
  • 1f1463c482 v0.9.0-rc.3 v0.9.0-rc.3 Alex Orlenko 2023-07-28 22:07:26 +01:00
  • bec40ee5ea mlua-sys: v0.3.1 Alex Orlenko 2023-07-28 22:04:00 +01:00
  • dc94d51d97 Update Luau compiler options Alex Orlenko 2023-07-28 21:45:19 +01:00
  • 3a096ae64a Fix warning when compiling chunk tests Alex Orlenko 2023-07-28 21:45:13 +01:00
  • a85e757d4d Bump luau-src to v0.6.0+luau588 This release has better codegen support (and breaking changed unfortunately) Alex Orlenko 2023-07-28 18:30:31 +01:00
  • 312886846c Fix link to v0.9 release notes in README Alex Orlenko 2023-07-28 11:14:58 +01:00
  • cdc1c8415e v0.9.0-rc.2 v0.9.0-rc.2 Alex Orlenko 2023-07-28 00:24:37 +01:00
  • f2142731fd mlua-sys: v0.3.0 Alex Orlenko 2023-07-28 00:23:49 +01:00
  • 1dd62c5ffc mlua_derive: v0.9.0-rc.2 Alex Orlenko 2023-07-28 00:23:04 +01:00
  • 95d8b2fd0f Update v0.9 release notes Alex Orlenko 2023-07-28 00:22:28 +01:00
  • 51a2959312 Add v0.9 release notes Prepare v0.9-rc.2 release Alex Orlenko 2023-07-28 00:07:31 +01:00
  • 28bcc73f2c Move impl IntoLua for WrappedFunction to the function.rs file Alex Orlenko 2023-07-27 15:19:34 +01:00
  • 8b71f94141 Fix AsChunk trait to support capturing wrapped Lua types (AnyUserData::wrap() and Function::wrap()). This is a breaking change, the 'lua lifetime used to in environment moved to the trait declaration. Alex Orlenko 2023-07-27 13:47:47 +01:00
  • 3bda1351c3 Fix lua51/52 case in userdata tests Alex Orlenko 2023-07-26 23:02:15 +01:00
  • 4daa631178 Set __type metatable field for Luau instead of __name. Other Lua versions continue to use __name field. Also make MetaMethod enum non-exhaustive (and add Type variant) Closes #295 Alex Orlenko 2023-07-26 21:41:28 +01:00
  • 9f5325ef2f Use c-unwind ABI (Rust 1.71+) Alex Orlenko 2023-07-22 23:35:34 +01:00
  • 6fb65a8fbe Fix loading luau code starting with \t Alex Orlenko 2023-07-22 18:44:44 +01:00
  • f6dff65d9b Do not rely on vendored feature when testing luajit memory limit Alex Orlenko 2023-07-21 23:25:28 +01:00
  • 4fa9aa1e5b Pin lua-src and luajit-src versions Alex Orlenko 2023-07-21 22:50:54 +01:00
  • e1c075fa51 Use giraffate/clippy-action Alex Orlenko 2023-07-21 01:13:30 +01:00
  • df9251fb52 Support LUA_LIB_NAME in module mode for windows. In this mode we will link with the particular lua library. Alex Orlenko 2023-07-21 00:54:14 +01:00
  • ead6be4a52 Make module and vendored features mutually exclusive Alex Orlenko 2023-07-20 23:23:03 +01:00
  • 4f48c7e5dc Update README Alex Orlenko 2023-07-20 21:58:01 +01:00
  • fac39a2f46 Drop openresty specific luajit extensions Alex Orlenko 2023-07-20 01:02:23 +01:00
  • 483e6be207 Support vendored module mode for windows (raw-dylib linking) This is requires Rust 1.71+ Alex Orlenko 2023-07-18 01:45:20 +01:00
  • 0e030d21b0 Add #[derive(FromLua)] macro to opt-in into FromLua<T> where T: 'static + Clone (userdata type). Future macro implementations will allow making T from Lua tables/other values. Relates to #291. Alex Orlenko 2023-07-16 01:57:28 +01:00
  • 355a0606c3 v0.9.0-rc.1 v0.9.0-rc.1 Alex Orlenko 2023-07-11 16:35:57 +01:00
  • 2277ee4860 Rename UserDataRegistrar to LuaUserDataRegistry Alex Orlenko 2023-07-11 22:15:15 +01:00
  • 8a4977e8e7 Use pretty format in the repl example Alex Orlenko 2023-07-11 21:39:05 +01:00
  • 128c357e07 Use __tostring if __name is not available when pretty printing userdata values Alex Orlenko 2023-07-11 21:36:02 +01:00
  • 9f0fc27c52 Make Lua::push_value() and Lua::pop_value() public (but hidden from the docs). Can be useful for low-level intergration with mlua values. Also closes #215. Alex Orlenko 2023-07-11 20:03:41 +01:00
  • bfd1c29c0a Add back Table::raw_sequence_values() with deprecation notice Alex Orlenko 2023-07-11 16:02:28 +01:00
  • 5fca2db6d3 Revert Add error-send feature Alex Orlenko 2023-07-11 15:50:15 +01:00
  • 8ecbf5b76a v0.9.0-rc.1 Alex Orlenko 2023-07-11 01:07:59 +01:00
  • d037c31b4d mlua-sys: v0.2.1 Alex Orlenko 2023-07-11 01:07:37 +01:00
  • 4fe89c9d45 mlua_derive: v0.9.0-rc.1 Alex Orlenko 2023-07-11 01:07:07 +01:00
  • 389526bb80 Some doc improvements Alex Orlenko 2023-07-11 00:23:31 +01:00
  • 4adc3116f9 Add error-send feature Alex Orlenko 2023-07-11 00:20:52 +01:00
  • 8e0bdc9934 Remove clippy::let_and_return ignore Alex Orlenko 2023-07-10 22:58:15 +01:00
  • 7dc6e4c132 Add Error::runtime() helper Alex Orlenko 2023-07-10 22:41:03 +01:00
  • 44b8c8b7a6 Add AnyUserData::wrap() to more easy way of creating _any_ userdata in Lua. This is similar to Function::wrap(). Alex Orlenko 2023-07-10 16:36:38 +01:00
  • 6b8b79266f Drop futures-timer dev-dependency Alex Orlenko 2023-07-10 01:16:27 +01:00
  • 08ab685d8d Update itertools dev-dependency Alex Orlenko 2023-07-10 01:16:20 +01:00
  • 057deb0169 Update rustyline dependency to 12.0 Alex Orlenko 2023-07-10 01:05:40 +01:00
  • 44533d2c9d Add new module attribule skip_memory_check to improve performance in module mode (by skipping memory allocations check) with extra risks. Alex Orlenko 2023-07-10 00:43:19 +01:00
  • 54c7a2d191 Update compile tests Alex Orlenko 2023-07-10 00:10:20 +01:00
  • c38a1f060b Various cosmetic changes Alex Orlenko 2023-07-10 00:04:40 +01:00
  • 5dca743b0c Improve performance AnyUserData::{is_serializable/inspect/serialize} Alex Orlenko 2023-07-10 00:01:26 +01:00
  • 01c1952c9f Rename AnyUserData::get_*_user_value to AnyUserData::*_user_value. To be more consistent with function like Lua::named_registry_value, Lua::add_data_ref and os on. Alex Orlenko 2023-07-09 23:50:44 +01:00
  • dbc3dd95d4 Fix Luau vector4 formatting when throwing it in exception Alex Orlenko 2023-07-09 23:12:49 +01:00
  • a9b0cdfc03 Take &str as function name in TableExt and AnyUserDataExt traits Alex Orlenko 2023-07-09 22:16:53 +01:00
  • 1c20494158 Use usize instead of c_int for table capacity (Lua::create_table_with_capacity) Alex Orlenko 2023-07-09 14:58:37 +01:00
  • c9294ad642 Add #[must_use] hint and const to some Luau Compiler functions Alex Orlenko 2023-07-09 14:09:50 +01:00
  • 3a71bfb8a0 Refactor Lua 5.4 warnings to use &str instead of CStr Alex Orlenko 2023-07-09 13:41:03 +01:00
  • 24e14c4874 Always set hook on a current Lua context (state) and remove MainThreadNotAvailable as no longer needed Alex Orlenko 2023-07-09 12:33:21 +01:00
  • 20826a69ae Re-export ffi crate (mlua-sys) Alex Orlenko 2023-07-09 11:31:59 +01:00
  • 5127903c38 Remove generic type parameter from init_userdata_metatable Alex Orlenko 2023-07-08 16:56:55 +01:00
  • 541139b944 Change Lua ref types Debug print from Ref{index} to Ref{pointer} The index is always uniq per instance, but pointer can exactly tell when several values reference to the same Lua internal value. Alex Orlenko 2023-07-08 12:52:14 +01:00
  • 925a2816cc clippy Alex Orlenko 2023-07-06 00:59:46 +01:00
  • b3b8d79446 Make Debug interface more user friendly - use String instead of Vec<u8> - update docs - unify fields between lua5.x/luau - line numbers are usize Alex Orlenko 2023-07-06 00:38:33 +01:00
  • 85f17a269d Add Table:is_empty() function Alex Orlenko 2023-06-26 10:50:18 +01:00
  • b169031d4e Don't use any metamethods in Table::sequence_values() iterator. This is matches with Table::pair() iterator. Remove Table::raw_sequence_values() iterator. Alex Orlenko 2023-06-26 10:46:59 +01:00
  • 399e469328 Update "async userdata method" benchmark Alex Orlenko 2023-06-21 22:23:43 +01:00
  • 1367a033d7 Don't clone function when doing call_async() Alex Orlenko 2023-06-21 13:14:17 +01:00
  • c1168d3ec1 Refactor call_async() functions to use static dispatch outside of traits Alex Orlenko 2023-06-21 12:44:24 +01:00
  • b05698d55b impl UserData for Rc<T> and Arc<T> where T: UserData Alex Orlenko 2023-06-21 01:30:09 +01:00
  • aeacf6cacc Remove allow(dead_code) from mlua-sys build scripts Alex Orlenko 2023-06-20 23:49:48 +01:00
  • 1f0e81c9a1 Add a dedicated type for Luau vector. Refactor existing implementation and add 4-dimensional vectors support. Alex Orlenko 2023-06-20 12:50:06 +01:00
  • c2bfc9ec52 Implement PartialEq<[T]> for tables Alex Orlenko 2023-06-19 23:28:08 +01:00
  • 9fdba541e9 Update UserDataMethods::add_async_method() functions to take &T as second argument instead of cloning T. New functions: UserDataMethods::add_async_method_mut(), UserDataMethods::add_async_meta_method_mut(). Alex Orlenko 2023-06-15 00:34:41 +01:00
  • cf0524aa23 Use lua_iscfunction instead of lua_getinfo in Function::environment() Alex Orlenko 2023-06-08 09:33:48 +01:00
  • 03b6dfb2c3 v0.9.0-beta.3 v0.9.0-beta.3 Alex Orlenko 2023-06-07 14:40:49 +01:00
  • cf1cb31150 mlua_derive: v0.9.0-beta.2 Alex Orlenko 2023-06-07 13:08:02 +01:00
  • 7d586f52f2 mlua-sys: v0.2.0 Alex Orlenko 2023-06-07 13:06:51 +01:00
  • e85818e199 mlua-sys: include luau to luau-codegen feature flag Alex Orlenko 2023-06-07 13:05:16 +01:00
  • 16bec29274 Fix setting Luau version number in _VERSION env var Alex Orlenko 2023-06-07 12:35:45 +01:00
  • 5a135a331a Add UserDataFields::add_field() method to add static fields to UserData. Plus UserDataFields::add_meta_field() for static meta fields. Fix propagating fields to wrapped UserData types. Alex Orlenko 2023-06-07 12:18:24 +01:00
  • e7b712e29f Rely on LUA_MINSTACK in callbacks Alex Orlenko 2023-06-06 21:38:45 +01:00
  • d5483988d2 Optimize polling async functions (40% performance win) Alex Orlenko 2023-06-04 20:53:12 +01:00
  • 0f5c68dcf8 Update criterion to 0.5 Alex Orlenko 2023-06-04 18:31:10 +01:00
  • 8ab0ccf11c Don't keep poll function in environment globals when polling async functions. This is redundant after deprecating scoped async. Closes #281 Alex Orlenko 2023-06-04 02:31:29 +01:00
  • 9596f2e9ee Fix warning when compiling for lua51 Alex Orlenko 2023-06-03 14:24:34 +01:00
  • 1dc32452e6 Support getting and setting environment for Lua functions. Closes #218 Alex Orlenko 2023-06-03 12:56:49 +01:00
  • 9785722d61 Require environment to be a Table instead of Value in Chunks. In addition to that, AsChunk::env() renamed to AsChunk::environment(). Alex Orlenko 2023-06-02 23:59:16 +01:00
  • c905a34b1d (Luau) Set thread globals to main thread globals when resetting the thread Alex Orlenko 2023-06-02 21:13:23 +01:00
  • a1089dbf95 Optimize a bit calling Rust functions from Lua. This is done by reusing upvalue as a captured variable. Also in async functions upvalue is always set (async cannot be scoped) so extra checks removed. Alex Orlenko 2023-05-30 15:15:20 +01:00
  • baf25e263f Change _mlua to __mlua prefix for internal chunk names Alex Orlenko 2023-05-30 00:36:09 +01:00
  • 3abf73dee5 Update FunctionInfo doc and interface Alex Orlenko 2023-05-30 00:33:57 +01:00
  • 4adebd31f9 Update .gitignore Alex Orlenko 2023-05-30 00:33:16 +01:00
  • cea2d7fd15 Refactor application data container. Now it's allowed at the same time mutably and immutably borrow different types. Each value in the application data container is stored in it's own RefCell wrapper. Also added new function Lua::try_set_app_data(). Alex Orlenko 2023-05-29 00:07:03 +01:00
  • e0224ab159 Use futures-core and futures-tasks via futures-util. Just to reduce number of dependencies. Alex Orlenko 2023-05-28 10:32:50 +01:00
  • 6dee339783 Use lua_closethread in AsyncThread::drop() Alex Orlenko 2023-05-28 01:43:15 +01:00
  • b674d7906d Include (known) userdata type to Value debug pretty-print Alex Orlenko 2023-05-27 23:57:43 +01:00
  • 3d7796de55 clippy Alex Orlenko 2023-05-27 22:08:42 +01:00
  • 4306e6e978 Add Value::to_string() method similar to luaL_tolstring. It uses __tostring metamethod if set. Closes #279 Alex Orlenko 2023-05-26 23:52:48 +01:00
  • 68e65a8ffe Set __name field in userdata metatable if not provided Alex Orlenko 2023-05-25 10:59:46 +01:00