1764 Commits

Author SHA1 Message Date
Alex Orlenko 247208edb1 v0.11.4 v0.11.4 2025-09-28 23:46:55 +01:00
Alex Orlenko e08768cc5e Derive Default for Value (clippy) 2025-09-28 23:42:12 +01:00
Alex Orlenko 5b38af9746 AsyncCallFuture is Unpin 2025-09-19 10:00:28 +01:00
Alex Orlenko 54907f80c5 Add SerializableValue to lib and prelude exports 2025-09-12 12:40:43 +01:00
Alex Orlenko ae512f2b49 Remove const from SerializableValue (it's not really useful) 2025-09-12 12:40:00 +01:00
Alex Orlenko 53c159b6cb Unhide Value::to_serializable 2025-09-12 11:49:43 +01:00
Alex Orlenko 2beca6ebe1 Add test for Table::for_each_value 2025-09-12 11:49:37 +01:00
Alex Orlenko 09da7a41e5 Add new serde option "detect_mixed_tables"
This option would allow detecting mixed tables (with array-like and map-like entries or several borders)
to encoding them chosing the best method (as a map or as a table).
2025-09-12 11:11:18 +01:00
Alex Orlenko bad20374ad Simplify Table::clear method
There is no need to traverse array part, lua_next will cover everything
2025-09-08 23:37:28 +01:00
Alex Orlenko 40b507c3ec Add ObjectLike::get_path helper 2025-09-04 19:12:44 +01:00
Andrew Dunbar 537cc995f6 Copyedit English in README.md (#639) 2025-09-04 14:59:24 +01:00
Alex Orlenko 5d27cb91b2 Add optional __namecall optimization for Luau
Add `UserDataRegistry::enable_namecall()` hint to set `__namecall` metamethod to enable Luau-specific method resolution optimization.
2025-09-02 00:53:12 +01:00
Alex Orlenko c70a636ca9 Remove newlines from yield_with examples 2025-08-30 12:51:53 +01:00
Alex Orlenko 13ff0ca798 v0.11.3 v0.11.3 2025-08-29 23:11:21 +01:00
Alex Orlenko 44f49e35d6 Update CHANGELOG 2025-08-29 00:18:06 +01:00
Alex Orlenko e1ee4058a6 Add new benchmark to measure complex userdata method calls 2025-08-28 23:56:03 +01:00
Alex Orlenko f06d0020ea Add test to emulate method through field 2025-08-28 23:50:18 +01:00
Alex Orlenko d399559d30 Add Lua::yield_with to allow yielding Rust async functions and exchange values between Lua coroutine and Rust.
This functionality is similar to `coroutine.yield` and `coroutine.resume` without C restrictions.
2025-08-28 18:41:24 +01:00
Alex Orlenko 30735d5ff1 Fix thread recovery when pushing a bad arg
We should not erase thread stack if a bad argument is pushed before resuming the thread.
2025-08-25 23:07:37 +01:00
Alex Orlenko 75c23e5853 Add lua_cpcall to Luau ffi (0.688+) 2025-08-25 12:54:17 +01:00
Alex Orlenko 347856b806 Do not try to yield at non-yielable points in Luau interrupt
In particular we cannot yeild across metamethod/C-call boundaries.
This behaviour matches with Lua 5.3+ yielding from hooks only at safe points.
Closes #632
2025-08-25 12:19:50 +01:00
Alex Orlenko 774a63bece Add Buffer::cursor() method
This can be useful for providing access to buffers through core IO traits.
2025-08-24 11:29:01 +01:00
Alex Orlenko c481c87eac Add Lua::create_buffer_with_capacity method
This allow creating a preallocated buffer with specified size initialized to zero.
2025-08-23 22:38:55 +01:00
Alex Orlenko 85b280a9d6 Update nightly Rust error message matching 2025-08-23 09:40:13 +01:00
Alex Orlenko db7b782d3c Remove lifetimes from short type names 2025-08-23 09:13:31 +01:00
Alex Orlenko 5f38445558 Fix warnings 2025-08-20 16:25:06 +01:00
Alex Orlenko df0a44d405 Make Lua reference values cheap to clone
Instead of locking the VM and making a copy on auxiliary thread, track number of references using Rust ref counter.
This should also help reducing number of used references (they are limited to to 1M usually) on auxiliary thread.
2025-08-20 12:05:37 +01:00
Alex Orlenko f0806a6d62 Lower fastpath table creation limit to 1 << 26
When Lua is configured without memory restrictions, we use fastpath for table creation (unprotected mode).
In generally it's safe as long as we `abort()` on allocation failure.
However some Lua versions have additional restrictions on table size that we need to adhere in mlua too.
Probably Luau has the lowest limits.
Fixes #627
2025-08-13 22:49:40 +01:00
Alex Orlenko 3516f4c6ca v0.11.2 v0.11.2 2025-08-10 00:53:45 +01:00
Alex Orlenko ca73583714 Update CHANGELOG 2025-08-10 00:53:01 +01:00
Alex Orlenko 36560435f7 Add push_into_stack_multi fastpath to Variadic 2025-08-10 00:35:51 +01:00
Alex Orlenko 763c2b2564 Update repl example: don't print newline if no values returned 2025-08-10 00:20:20 +01:00
Alex Orlenko bafdb6138c Update dependencies 2025-08-10 00:19:54 +01:00
Alex Orlenko c9d6a610e1 mlua-sys: v0.8.3 2025-08-10 00:11:05 +01:00
Alex Orlenko bd63f63bc9 Use ascii lowercase for module aliases
This matches with Luau 0.686 changes
2025-08-09 19:14:31 +01:00
piz-ewing c035c23a15 fix: normalize_chunk_name handles Windows paths with drive letter (#623)
Co-authored-by: ewing <ewing@MacBook-Pro.local>
2025-08-04 22:34:36 +01:00
Alex Orlenko cb153a52b2 Make Luau registered aliases case-insensitive
Executing `require("@my_module")` or `require("@My_Module")` should give the same result and use case-insensitive name.
See #620 for details
2025-07-26 22:23:16 +01:00
Alex Orlenko b1c69d3005 Use to_bits comparison to check if a float value can be represented as an integer losslessly.
This allows to simplify the code while still maintaining "negative zeros" edge case.
Thanks @JasonHise for the suggestion.
2025-07-25 21:25:08 +01:00
Alex Orlenko 841bd332e4 Fix LuaJIT negative zero tests 2025-07-25 15:24:04 +01:00
Alex Orlenko 815d1bd7c9 Better handling negative zeros to match Lua 5.3+ behavior
In Lua 5.3+ the function `lua_isinteger` returns "false" for -0.0 numbers.
In earlier Lua versions we should follow the same behavior to avoid losing the sign when converting to Integer.
Close #618
2025-07-25 14:32:47 +01:00
Alex Orlenko 78331ceebe v0.11.1 v0.11.1 2025-07-15 22:43:18 +01:00
Alex Orlenko f945a35cbd Execute metatable destructor in Table::set_metatable at the end of invocation
Before this change, destructor was executed shortly after pushing metatable to ref_thread.
2025-07-15 19:14:46 +01:00
Alex Orlenko 459edb6816 Always grow aux ref stack considering the reserve 2025-07-15 16:32:22 +01:00
Alex Orlenko 00328b0b64 Protect Lua::push_c_function for Lua <5.2 2025-07-15 16:11:31 +01:00
Alex Orlenko 928d94d255 v0.11.0 v0.11.0 2025-07-14 15:33:02 +01:00
Alex Orlenko 583c35a172 Prepare for v0.11.0 2025-07-12 22:47:20 +01:00
Alex Orlenko 1791c599f4 mlua-sys: v0.8.2 2025-07-12 22:46:37 +01:00
Alex Orlenko 1e48817a64 Fix deregistering previously-registered userdata 2025-07-12 19:20:15 +01:00
Alex Orlenko 8d219503dd Opt-out from R: MaybeSend in AsyncThread<R> 2025-07-12 15:34:04 +01:00
Alex Orlenko 95367855c1 Return AsyncCallFuture<R> instead of opaque impl Future from ObjectLike trait. 2025-07-12 15:30:58 +01:00