1211 Commits

Author SHA1 Message Date
Alex Orlenko bb0a6070c4 v0.9.0 v0.9.0 2023-08-17 11:38:42 +01:00
Alex Orlenko 60f1c16ddb mlua-sys: v0.3.2 2023-08-16 14:59:16 +01:00
Alex Orlenko 17809a390c mlua_derive: v0.9.0 2023-08-16 01:25:12 +01:00
Alex Orlenko 7662a7e4ff Update non-static (scoped) userdata:
- Use the new stack api
- Support static fields constructor
- Better error messages (on bad arguments)
2023-08-15 01:22:57 +01:00
Alex Orlenko d769a95fc5 Add Scope::create_any_userdata() 2023-08-14 17:39:51 +01:00
Alex Orlenko 0e4476c2e3 Add Lua::set_vector_metatable() method (unstable) 2023-08-12 22:46:21 +01:00
Alex Orlenko d48a2b3f6c Add OwnedThread type (unstable) 2023-08-12 21:18:12 +01:00
Alex Orlenko b3592bc23e Update mutable_globals pointer type to const (luau 0.590) 2023-08-12 17:43:25 +01:00
Alex Orlenko 052310e93d Update doc for deny_unsupported_types option 2023-08-12 17:40:39 +01:00
Alex Orlenko 09eb7f251b Support options for Value::serialize() implementation
To match `lua.from_value_with()` functionality.
2023-08-12 17:24:57 +01:00
Alex Orlenko c137da7618 Update to Luau 0.590 2023-08-12 14:12:59 +01:00
Alex Orlenko c0c6a33f94 Add new option sort_keys to DeserializeOptions (Lua::from_value method)
Closes #303
2023-08-07 11:44:52 +01:00
Alex Orlenko 0cb0a345dd Hide clippy warning converting i32 to i32 2023-08-07 11:44:35 +01:00
Alex Orlenko 3e479be4e5 Cosmetic changes for the Value conversions + add tests 2023-08-06 23:41:27 +01:00
Alex Orlenko 170aa53e29 Change Table::raw_len() output type to usize. 2023-08-06 22:45:06 +01:00
Akase Cho 021ee946fc Add helper functions to Value (#299)
Add helper functions to `Value`
2023-08-06 22:44:32 +01:00
Alex Orlenko 0b928fdfee Faster table ops 2023-08-03 10:37:52 +01:00
Alex Orlenko e858384cd4 Add table get/set benchmark 2023-08-03 10:37:39 +01:00
Alex Orlenko c062cddd87 Fastpath IntoLua/FromLua for StdString and &str
This includes direct push to Lua stack and getting value from Lua stack.
2023-08-03 10:02:20 +01:00
Alex Orlenko 94a79656ad Faster Function::call() 2023-08-03 01:16:52 +01:00
Alex Orlenko cd0c8a4584 Optimize async functionality:
Rewrite using the new `push_into_stack()`/`from_stack()` methods.
Also store thread state (pointer) in `Thread` struct to avoid getting it every time.
Async userdata methods still need to have arguments stored in ref thread as stack is empty on every poll().
2023-08-03 00:56:17 +01:00
Alex Orlenko 4fff14a144 impl Drop for MultiValue
This action would automatically return container to the pool on drop (instead of doing it manually)
2023-08-01 11:21:26 +01:00
Alex Orlenko 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.
2023-07-31 22:13:23 +01:00
Alex Orlenko 114f072269 Update module entrypoint function.
Return c_int instead of Result (and avoid potential panic on Rust side).
2023-07-31 17:49:07 +01:00
Alex Orlenko b3211f13ee Minor fixes in v0.9 release notes 2023-07-31 10:17:40 +01:00
Alex Orlenko 1f1463c482 v0.9.0-rc.3 v0.9.0-rc.3 2023-07-28 22:07:26 +01:00
Alex Orlenko bec40ee5ea mlua-sys: v0.3.1 2023-07-28 22:04:00 +01:00
Alex Orlenko dc94d51d97 Update Luau compiler options 2023-07-28 21:45:19 +01:00
Alex Orlenko 3a096ae64a Fix warning when compiling chunk tests 2023-07-28 21:45:13 +01:00
Alex Orlenko a85e757d4d Bump luau-src to v0.6.0+luau588
This release has better codegen support (and breaking changed unfortunately)
2023-07-28 20:30:46 +01:00
Alex Orlenko 312886846c Fix link to v0.9 release notes in README 2023-07-28 11:14:58 +01:00
Alex Orlenko cdc1c8415e v0.9.0-rc.2 v0.9.0-rc.2 2023-07-28 00:24:37 +01:00
Alex Orlenko f2142731fd mlua-sys: v0.3.0 2023-07-28 00:23:49 +01:00
Alex Orlenko 1dd62c5ffc mlua_derive: v0.9.0-rc.2 2023-07-28 00:23:04 +01:00
Alex Orlenko 95d8b2fd0f Update v0.9 release notes 2023-07-28 00:22:28 +01:00
Alex Orlenko 51a2959312 Add v0.9 release notes
Prepare v0.9-rc.2 release
2023-07-28 00:07:31 +01:00
Alex Orlenko 28bcc73f2c Move impl IntoLua for WrappedFunction to the function.rs file 2023-07-27 15:19:34 +01:00
Alex Orlenko 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.
2023-07-27 13:56:48 +01:00
Alex Orlenko 3bda1351c3 Fix lua51/52 case in userdata tests 2023-07-26 23:18:30 +01:00
Alex Orlenko 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
2023-07-26 21:43:26 +01:00
Alex Orlenko 9f5325ef2f Use c-unwind ABI (Rust 1.71+) 2023-07-22 23:54:30 +01:00
Alex Orlenko 6fb65a8fbe Fix loading luau code starting with \t 2023-07-22 18:44:44 +01:00
Alex Orlenko f6dff65d9b Do not rely on vendored feature when testing luajit memory limit 2023-07-21 23:25:28 +01:00
Alex Orlenko 4fa9aa1e5b Pin lua-src and luajit-src versions 2023-07-21 23:22:47 +01:00
Alex Orlenko e1c075fa51 Use giraffate/clippy-action 2023-07-21 10:34:29 +01:00
Alex Orlenko df9251fb52 Support LUA_LIB_NAME in module mode for windows.
In this mode we will link with the particular lua library.
2023-07-21 10:34:26 +01:00
Alex Orlenko ead6be4a52 Make module and vendored features mutually exclusive 2023-07-20 23:23:03 +01:00
Alex Orlenko 4f48c7e5dc Update README 2023-07-20 21:58:01 +01:00
Alex Orlenko fac39a2f46 Drop openresty specific luajit extensions 2023-07-20 01:02:23 +01:00
Alex Orlenko 483e6be207 Support vendored module mode for windows (raw-dylib linking)
This is requires Rust 1.71+
2023-07-20 00:43:57 +01:00