Commit Graph

  • a13c188de3 Rename ToLua/ToLuaMulti -> IntoLua/IntoLuaMulti Alex Orlenko 2022-12-19 23:00:47 +00:00
  • c60f633a62 Add "unstable" feature flag. Hide owned types under the new feature flag. Drop OwnedString/OwnedThread types (unlikely they are useful). Alex Orlenko 2022-12-19 22:11:52 +00:00
  • 56abc4a700 Refactor AsChunk trait Alex Orlenko 2022-12-19 14:59:21 +00:00
  • 9b4e3a1598 Refactor LuaInner state Add static_assertions to check for auto traits impl on compilation stage Bump MSRV to 1.63 (required for Ref::filter_map) Alex Orlenko 2022-12-19 11:37:40 +00:00
  • 0aa30226df Check for invalid args when parsing #[lua_module(...)] proc macro Alex Orlenko 2022-12-13 23:23:58 +00:00
  • fdb5724053 Add ?Sized to PartialEq for Lua String Alex Orlenko 2022-12-09 23:28:51 +00:00
  • b532f86674 feat: Support custom name of lua_module rise0chen 2022-11-29 10:46:51 +08:00
  • c44463f030 Replace impl AsRef<str> with simple &str Alex Orlenko 2022-10-18 10:59:13 +01:00
  • de38e299fc Use impl AsRef<str> for userdata methods/fields instead of generic param. Use impl AsRef<str> for module names and named registry values. Alex Orlenko 2022-10-18 00:57:16 +01:00
  • 7526773a90 Do not clear usevalues when taking value out of userdata. It has big performance penalty. Lua GC can collect uservalues when userdata is not referenced anymore. Alex Orlenko 2022-10-17 02:27:41 +01:00
  • bf79d9e75d Initial implementation of owned Lua types Alex Orlenko 2022-10-16 23:36:26 +01:00
  • 02c08c6350 upgrade bstr from 0.2 to 1.0 Joel Natividad 2022-10-11 15:19:23 -04:00
  • 05eb20f9c6 Fix subtraction overflow when calculating index for MultiValue::get(). Return None instead of panic in debug mode. Fixes #232 Alex Orlenko 2022-12-15 21:10:31 +00:00
  • 9716918517 Fix lifetime of DebugNames in Debug::names() and DebugSource in Debug::source(). This can cause use-after-free if used wrong. Now invalid code would not compile. Reported in #230 Alex Orlenko 2022-12-09 23:55:38 +00:00
  • c88417a3b6 Redefine _VERSION for Luau to include version number. https://github.com/khvzak/mlua/discussions/228 Alex Orlenko 2022-12-03 21:04:21 +00:00
  • 6e95386f30 Update Luau to 0.555 (luau-src 0.5.0) This version includes inreased LUAI_MAXCSTACK limit (100000) Alex Orlenko 2022-12-03 17:55:26 +00:00
  • 6807dfa22e v0.8.6 v0.8.6 Alex Orlenko 2022-11-07 01:02:52 +00:00
  • f27c49f931 Fix bug when recycled Registry slot can be set to Nil. This can result in allocating the same slot twice and rewriting old value. Lua uses (registry) table length to find next free slot and having Nil in the middle of the table can impact length calculation. With this fix we ensure that Nil values uses a special LUA_REFNIL slot. Alex Orlenko 2022-11-07 00:10:57 +00:00
  • 693a808b6e v0.8.5 v0.8.5 Alex Orlenko 2022-10-30 12:31:26 +00:00
  • a6ca65aa74 Better checks and tests when trying to modify a Luau readonly table Alex Orlenko 2022-10-30 11:41:09 +00:00
  • a7278cab78 Fix Table::raw_push for luau when readonly Alex Orlenko 2022-10-29 23:02:08 +01:00
  • e1bbd00a33 Fix getting caller information from Lua::load Alex Orlenko 2022-10-28 10:43:05 +01:00
  • e98998d6ac Add push/pop methods to Table Alex Orlenko 2022-10-23 23:27:17 +01:00
  • cca177df5b Minor serde optimizations Alex Orlenko 2022-10-23 03:13:24 +01:00
  • 65396a910f Optimize Lua::create_table to use reference thread if possible Alex Orlenko 2022-10-18 01:09:35 +01:00
  • de69d10d73 Optimize Lua::create_string to use reference thread if possible Alex Orlenko 2022-10-18 00:57:16 +01:00
  • 959e61b97c Optimize tables: - Use reference thread directly for simple cases - Fix issue when calling raw_set on readonly table (Luau) - Add fasttrack methods for get/set/len when metatable is not set Alex Orlenko 2022-10-18 00:34:23 +01:00
  • 1040c0a347 Fix typo Alex Orlenko 2022-10-18 00:00:11 +01:00
  • 9045419586 Strings optimizations: get access to bytes directly from ref thread. Alex Orlenko 2022-10-17 02:37:36 +01:00
  • fcd162f3eb Replace Lua::ref_thread_exec Alex Orlenko 2022-10-17 00:39:55 +01:00
  • 0354703dbf Update formatting (Lua registry values) Alex Orlenko 2022-10-17 00:16:52 +01:00
  • 9831d0e397 Check that allocation does not exceed isize::MAX See https://github.com/rust-lang/rust/issues/101899 Alex Orlenko 2022-10-22 23:13:02 +01:00
  • 7f14d93c2b v0.8.4 v0.8.4 Alex Orlenko 2022-10-09 14:40:15 +01:00
  • 29c6c9cb58 Fix clippy warnings Alex Orlenko 2022-10-09 14:01:04 +01:00
  • e01af22bac Update push_userdata_ref Alex Orlenko 2022-10-09 13:56:30 +01:00
  • cfa959e599 Don't allocate extra byte for userdata (luau) Alex Orlenko 2022-10-09 13:56:06 +01:00
  • e523fb2c86 Update to Luau 0.548 (luau-src >=0.4) Alex Orlenko 2022-10-08 23:34:47 +01:00
  • 81a9998559 Update CI Alex Orlenko 2022-09-12 23:29:05 +01:00
  • 050ac4f5ad Add luaL_setfuncs to preserved functions Alex Orlenko 2022-09-05 22:01:03 +01:00
  • 967cbb53b0 Update compile tests Alex Orlenko 2022-08-23 23:12:37 +01:00
  • 44a8d86d8a Fix error message in tests (luau) Alex Orlenko 2022-08-23 23:08:00 +01:00
  • 33278d4a64 Check if chunk is empty in luaL_loadbufferx for Luau (fixes #200) Alex Orlenko 2022-08-23 11:35:08 +01:00
  • 20a16839aa Fix typo in doc comment Trisha 2022-08-19 09:30:11 -05:00
  • 83ed442bf9 v0.8.3 v0.8.3 Alex Orlenko 2022-08-02 12:43:15 +01:00
  • bf6708ba58 Fallback to Lua internal allocator if unable to create Lua VM with Rust one. This should fix #194 Alex Orlenko 2022-08-02 10:20:28 +01:00
  • 0cd724f63b Fix Lua assertion when inspecting another thread stack. The thread can be dead and it's not safe to call __tostring metamethod (if present) on error object. Fixes #195 Alex Orlenko 2022-08-01 16:39:55 +01:00
  • 5330b900fd Check that Lua state is non-null in init_from_ptr() Alex Orlenko 2022-08-01 15:19:46 +01:00
  • ee32dc33f3 Check that lua_newstate() returns non-null Lua state Alex Orlenko 2022-08-01 12:56:36 +01:00
  • ab029b087d Close to-be-closed variables for Lua 5.4 when using call_async functions Fixes #192 Alex Orlenko 2022-07-31 15:33:02 +01:00
  • 185fee956d v0.8.2 v0.8.2 Alex Orlenko 2022-07-25 14:23:25 +01:00
  • 4fc69be5f6 Update rustyline dev dependency Alex Orlenko 2022-07-25 14:14:01 +01:00
  • 3ec076693a Add FAQ Alex Orlenko 2022-07-23 12:48:34 +01:00
  • 95adf8df8e Add __iter to destructed metatable (luau) Alex Orlenko 2022-07-22 23:06:11 +01:00
  • 4a25eab257 Merge pull request #189 from hack3ric/master Alex Orlenko 2022-07-22 00:28:18 +01:00
  • 40fe937878 Fix a bug in Function::bind when args and binds are empty This leads to a Lua assertion due to using wrong stack index Alex Orlenko 2022-07-22 00:24:53 +01:00
  • a6b178328d Merge branch 'master' of https://github.com/hack3ric/mlua Eric Long 2022-07-21 20:55:28 +08:00
  • f3f173fcb6 Function::bind: simply clone the function if args are empty MultiValue Eric Long 2022-07-21 20:54:49 +08:00
  • d3b48cf2f3 Use Luau tags to mark userdata objects as destructed Alex Orlenko 2022-07-18 00:59:17 +01:00
  • f9ff6116db Use MaybeUninit instead of hack in protect_lua_closure Alex Orlenko 2022-07-17 11:33:51 +01:00
  • f75af6d75f Fix clippy warnings Alex Orlenko 2022-07-17 11:11:30 +01:00
  • 059e41bafb Optimize WrappedFailure userdata detection. This is done by comparing a metatable pointer to previously saved one (it never changes). Alex Orlenko 2022-07-17 10:57:36 +01:00
  • f7ee6dc635 Add lua_xpush to 5.1-5.4 Alex Orlenko 2022-07-17 00:03:40 +01:00
  • 0919ff21c9 Merge pull request #181 from hack3ric/master Alex Orlenko 2022-07-01 10:10:16 +01:00
  • 553251761f Add MultiValue::get & add clear error in Index Eric Long 2022-07-01 01:59:40 +08:00
  • b46b476f80 v0.8.1 v0.8.1 Alex Orlenko 2022-06-29 15:41:22 +01:00
  • 70e16b51ae Set source name to full file path in Luau require Alex Orlenko 2022-06-29 00:53:07 +01:00
  • 9596b97faa Update Lua::create_userdata doc about sharing metatable. Closes #175 Alex Orlenko 2022-06-29 00:25:26 +01:00
  • 8cbb3d8fae Merge pull request #180 from khvzak/userdata_proxy Alex Orlenko 2022-06-29 00:05:59 +01:00
  • e7f494530f Add Lua::create_proxy for easy access to UserData static fields and functions Closes #178 Alex Orlenko 2022-06-28 18:28:40 +01:00
  • 3746c3614f Merge pull request #179 from hack3ric/master Alex Orlenko 2022-06-28 22:56:28 +01:00
  • 9af1aaf889 Make clippy happy Alex Orlenko 2022-06-28 21:28:45 +01:00
  • c20eb20a59 Implement utilities for MultiValue Eric Long 2022-06-29 01:21:19 +08:00
  • 04ba93137c Add Table::to_pointer() and String::to_pointer() functions Alex Orlenko 2022-06-27 14:56:31 +01:00
  • 113f91ace3 Derive Default for Lua::MemoryInfo Alex Orlenko 2022-06-27 13:57:15 +01:00
  • ff0d923aae Don't use custom allocator for non-vendored LuaJIT (fixes #176) Alex Orlenko 2022-06-27 13:04:32 +01:00
  • d9ac7abff2 v0.8.0 v0.8.0 Alex Orlenko 2022-06-08 23:57:35 +01:00
  • 48aa97351d Add Sandboxing section to README Alex Orlenko 2022-06-08 23:56:26 +01:00
  • 4516ca0bb5 Forgotten part of userdata performance optimization for Lua 5.1 Alex Orlenko 2022-06-07 17:59:22 +01:00
  • 9005f32a98 Add ffi::luau::lua_tolightuserdata introduced in Luau 0.528 Alex Orlenko 2022-06-06 22:40:29 +01:00
  • 93d36b9068 More performance optimization (userdata part) Alex Orlenko 2022-06-06 21:42:55 +01:00
  • f9f32bffce Update bundled luau/jit versions Alex Orlenko 2022-06-06 15:59:28 +01:00
  • da5010e6de Switch to 2021 edition and bump MSRV to 1.56+ Alex Orlenko 2022-06-06 15:40:29 +01:00
  • 4afca8f5bb Prepare for v0.8.0 release Alex Orlenko 2022-06-02 22:44:07 +01:00
  • b065db37c2 Always use Rust allocator for Lua 5.1/u Alex Orlenko 2022-05-31 02:09:58 +01:00
  • a100ebb3d7 Fix luaL_requiref glb handling for Lua<=5.1 Alex Orlenko 2022-05-30 21:45:25 +01:00
  • a05a58b258 Update integer/number coercion logic Alex Orlenko 2022-05-30 19:26:12 +01:00
  • 3766cee4dd Experimental optimization to skip oom check Alex Orlenko 2022-05-29 21:52:50 +01:00
  • 99becdb590 More inline attributes Alex Orlenko 2022-05-29 20:17:09 +01:00
  • 799b4e9f0d Make Variadic::new and MultiValue::new const Alex Orlenko 2022-05-28 21:13:49 +01:00
  • 93f0b2a5de Update type of lua_Integer for lua51/52 Alex Orlenko 2022-05-27 12:26:56 +01:00
  • 62db3adde1 Add "send" test Alex Orlenko 2022-05-26 22:22:23 +01:00
  • afa343ff08 Add [track_caller] attribute when working with app data container Alex Orlenko 2022-05-26 20:16:09 +01:00
  • 4f06f614a9 v0.8.0-beta.5 v0.8.0-beta.5 Alex Orlenko 2022-05-25 01:15:20 +01:00
  • 30ba616a8a Correctly deserialize newtype struct (#168) Alex Orlenko 2022-05-24 23:26:17 +01:00
  • 0076aa735a Add Function::coverage for Luau to obtain coverage report Alex Orlenko 2022-05-24 01:20:23 +01:00
  • bcf2cbea37 Add Value::to_pointer() function. Closes #165 and #166. Alex Orlenko 2022-05-18 13:15:08 +01:00
  • 8cd594c609 Fix typo Alex Orlenko 2022-05-18 12:15:39 +01:00
  • 8d71ea79aa Cache bytecode for internal Lua chunks Alex Orlenko 2022-05-16 20:11:47 +01:00
  • 2a8c5c7f82 Refactor Function::bind implementation. Make it possible to bind async function arguments. Fixes #161 Alex Orlenko 2022-05-15 01:15:31 +01:00
  • 6b2ceb60c4 Fix Send impl Alex Orlenko 2022-05-12 19:24:12 +01:00