Alex Orlenko
0ea65a2985
Fix doc test
2022-04-03 22:13:54 +01:00
Alex Orlenko
f63f147265
Add `set_mutable_globals` to Luau compiler
2022-03-31 20:35:52 +01:00
Alex Orlenko
595dc3e95f
Move some Luau functionality to a new module
...
Immplement native "vector" function to construct vectors
2022-03-31 19:31:37 +01:00
Alex Orlenko
ac28c8d8d2
Add vector_lib/vector_ctor options to Luau Compiler (hidden)
2022-03-31 19:05:19 +01:00
Alex Orlenko
d5315da8d1
Fix tests
2022-03-31 12:23:21 +01:00
Alex Orlenko
516f01ed44
Increase internal caches size
2022-03-31 00:07:05 +01:00
Alex Orlenko
4492a20bbc
Make LuaHook as Fn instead of FnMut to remove Mutex and improve performance
2022-03-30 23:55:34 +01:00
Alex Orlenko
595bc3a2b3
Support Luau interrupts ( closes #138 )
2022-03-30 22:01:06 +01:00
Alex Orlenko
87c10ca93d
Sandboxing support
2022-03-28 23:42:35 +01:00
Alex Orlenko
f75b7b7879
Remove Lua::into_static/from_static
2022-03-26 00:30:57 +00:00
Alex Orlenko
ec1fa04085
Update docs
2022-03-25 00:43:54 +00:00
Alex Orlenko
714dd6249f
Enable Thread::reset for Luau
2022-03-23 21:13:48 +00:00
Alex Orlenko
9533f08d3a
Use `lua_xpush` for Luau
2022-03-23 01:24:54 +00:00
Alex Orlenko
0a3b65af88
Support `readonly` table attribute (luau)
2022-03-22 21:33:29 +00:00
Alex Orlenko
3a9c8c2da2
Add Luau vector datatype support
2022-03-22 21:14:06 +00:00
Alex Orlenko
55b778c68b
Fix clippy warnings
2022-03-22 00:47:31 +00:00
Alex Orlenko
c6d3727171
Prepare v0.8.0-beta.1
2022-03-21 01:37:08 +00:00
Alex Orlenko
4e0ba6559e
Add `require` function to Luau
2022-03-21 01:08:48 +00:00
Alex Orlenko
405cff5d49
Move StaticUserData* implementation from `lua` module to the new `userdata_impl`
2022-03-21 01:08:48 +00:00
Alex Orlenko
37cddc6b1c
Replace compat53_countlevels with lua_stackdepth for Luau
2022-03-21 01:08:48 +00:00
Alex Orlenko
2c069f7033
Update to luau 0.519
2022-03-21 01:08:48 +00:00
Alex Orlenko
1e61d1dadc
Return binary chunks support in safe mode.
...
Lua has many ways to load binary bytecode and this restriction was easy to bypass.
2022-03-21 01:08:47 +00:00
Alex Orlenko
32124b31a0
Move chunks structs to a new module.
...
Add Luau Compiler interface to compile sources.
2022-03-21 01:08:47 +00:00
Alex Orlenko
3e5f8e7bb8
Enable `Lua::inspect_stack` for Luau
2022-03-21 01:08:47 +00:00
Alex Orlenko
cab92f4ea2
Update luaL_traceback for Luau
2022-03-21 01:08:47 +00:00
Alex Orlenko
fa99f62a99
Fix __index and __newindex wrappers for Luau
2022-03-21 01:08:40 +00:00
Alex Orlenko
eed7b1f3af
More ffi module refactoring
2022-03-20 20:30:20 +00:00
Alex Orlenko
c322e028e2
Initial Luau support
2022-03-20 20:30:20 +00:00
Alex Orlenko
6dc127f4eb
Refactor ffi module
...
Initial Luau support work
2022-03-20 20:30:18 +00:00
Tarik02
d4f8dce597
Fix async userdata __index, __newindex metamethods
2022-03-20 20:03:47 +00:00
Alex Orlenko
c85616137a
v0.7.4
2022-03-01 19:59:49 +00:00
Alex Orlenko
10826a7e67
Update `create_registry_value` doc
2022-02-15 19:45:37 +00:00
Alex Orlenko
18c3255c90
Optimize `Lua::create_registry_value` by reusing previously expired registry keys.
2022-02-14 21:20:57 +00:00
Alex Orlenko
6190427f37
Add Lua::replace_registry_value
2022-02-14 20:51:24 +00:00
Alex Orlenko
9a5a341e44
Recognize LuaJIT TCDATA type to generate correct panic message.
...
Relates to #127
Should be fixed in a next major release by adding support of TCDATA type.
2022-02-12 18:40:18 +00:00
Alex Orlenko
dd91ebfbe5
Grow/check Lua stack in unpack
2022-02-12 17:10:43 +00:00
Alex Orlenko
f9fe869b76
Optimize async calls:
...
Rewrite "unpack" function using C api rather than high level abstraction.
2022-01-29 12:39:30 +00:00
Alex Orlenko
c213a85ef0
v0.7.3
2022-01-19 18:12:45 +00:00
Alex Orlenko
418e8fba32
v0.7.2
2022-01-17 11:12:46 +00:00
Alex Orlenko
5a06778fbc
Always restore original Lua state after creating Future in async call.
...
Fixes #121
2022-01-16 20:57:43 +00:00
Alex Orlenko
e33bdddc7a
Pass Box wrapped pointer to allocator fn instead of reference
2022-01-08 23:06:01 +00:00
Alex Orlenko
cfb5d3fd45
Fix clippy warnings
2021-12-28 12:23:06 +00:00
Alex Orlenko
386eb7a2b7
v0.7.1
2021-12-23 19:42:52 +00:00
Alex Orlenko
66c9c633b2
Generate traceback from level 0 (instead of 1)
...
Fixes #112
2021-12-23 17:53:20 +00:00
Alex Orlenko
f1e357ce52
Hide (doc) into_static/from_static methods
2021-12-01 00:28:08 +00:00
Alex Orlenko
be09a1fabf
Update lifetimes for few functions in Lua
2021-11-30 23:14:08 +00:00
Alex Orlenko
89580dd863
v0.7.0
2021-11-25 18:18:38 +00:00
Alex Orlenko
2fee3e7891
Update docs
2021-11-25 18:01:41 +00:00
Alex Orlenko
1b74c89509
More performance optimizations
2021-11-25 11:16:12 +00:00
Alex Orlenko
066d28f5e5
Update `Lua::unload` doc & fix clippy warnings
2021-11-23 19:01:23 +00:00
Alexander Polakov
d49757c7db
Add unload() to remove module
2021-11-23 18:36:57 +03:00
Alex Orlenko
170818c469
Add `call()` function to `TableExt` to call tables with `__call` metamethod as functions
2021-11-21 23:47:45 +00:00
Alex Orlenko
e2ebe65306
Add `get_named_user_value` and `set_named_user_value` to `AnyUserData`
2021-11-21 23:42:47 +00:00
Alex Orlenko
0e1be19cbb
Move hook_proc under `Lua::set_hook` to use callback_error_ext
2021-11-16 12:27:56 +00:00
Alex Orlenko
0ef709672d
Add set_warning_function/remove_warning_function/warning functions to Lua for 5.4
...
This utilizes Lua 5.4 warnings system (https://www.lua.org/manual/5.4/manual.html#pdf-warn )
2021-11-16 12:05:34 +00:00
Alex Orlenko
41503b4fb8
Update callback_error_ext (+ fix callback multi states handling)
2021-11-16 11:53:51 +00:00
Alex Orlenko
19bd254e1e
Update comments
2021-11-14 23:27:20 +00:00
Alex Orlenko
50f20e0c2c
Add thread (coroutine) cache to reset and later reuse to execute async functions.
...
It works on Lua 5.4 and LuaJIT (vendored) with `lua_resetthread` function.
2021-11-14 23:19:47 +00:00
Alex Orlenko
7efe807199
Include `StdLib` to prelude
2021-11-14 23:19:47 +00:00
Alex Orlenko
63ea8c7662
Rename wrapped_failures pool to cache
2021-11-14 23:19:47 +00:00
Alex Orlenko
863d36d5a1
Performance optimization: cache and reuse `MultiValue` containers
2021-11-12 15:32:53 +00:00
Alex Orlenko
a8017c10b9
Update callback_error(_ext)
2021-11-12 12:41:03 +00:00
Alex Orlenko
2c7d7117d2
Optimize MultiValue allocations (recycle old container)
2021-11-12 10:55:20 +00:00
Alex Orlenko
6d689c35aa
Update `hook::Debug` struct
2021-11-09 18:20:36 +00:00
Alex Orlenko
8af1304fd0
Add `Lua::inspect_stack` to get information about the interpreter runtime stack.
...
This functionality is provided by `lua_getstack`.
2021-11-09 14:18:14 +00:00
Alex Orlenko
153502ec73
Add `set_nth_user_value` and `get_nth_user_value` to `AnyUserData`
...
with `n` up to 65535 for all Lua versions.
2021-11-08 21:16:31 +00:00
Alex Orlenko
2ea2b1f4fb
Refactor `Error::CallbackError` reporting and include source to
...
fmt::Display implementation.
This fixes #71 .
2021-11-07 22:53:37 +00:00
Alex Orlenko
ef8c1556e6
Add optional Send to Lua::app_data
2021-11-07 15:03:17 +00:00
Alex Orlenko
b0da2fc439
Switch Table::serialize to FxHashSet
2021-11-07 14:49:19 +00:00
Alex Orlenko
204eedde3c
Merge branch 'dev'
2021-11-07 13:07:22 +00:00
Alex Orlenko
fbc2973aff
Fix recursive tables serialization when using `serde::ser::Serialize`
...
implementation for Table.
Fixes #98 .
2021-11-06 21:12:00 +00:00
Alex Orlenko
d0641d812f
Refactor a bit conversion int->number
2021-11-04 13:15:26 +00:00
Alex Orlenko
ad70ba54a5
Publish `AnyUserData::take`
2021-11-04 12:32:19 +00:00
Alex Orlenko
806f0bcef4
Add luajit52 support (LuaJIT with partial compatibility with Lua 5.2)
2021-11-04 12:26:11 +00:00
Alex Orlenko
0741db7565
Make (De)SerializeOptions as const
2021-11-04 01:07:38 +00:00
Alex Orlenko
d88a4282c7
Replace macro-based implementation `ToLua` for arrays to const generics
2021-11-04 00:59:39 +00:00
Alex Orlenko
d7d987fa14
Add async meta methods for all Lua except 51
2021-11-04 00:57:49 +00:00
Alex Orlenko
4d3ac6d8c5
Add new "application data" api
2021-10-19 11:45:39 +01:00
Alex Orlenko
a9ca99349c
Switch to FxHash
2021-10-19 11:45:38 +01:00
Alex Orlenko
f71db80a74
Change definition of `lua_State` to opaque struct
2021-10-19 11:45:38 +01:00
Alex Orlenko
09af3e021a
v0.6.6
2021-10-12 12:22:14 +01:00
Alex Orlenko
cab2e5a48e
Fix clippy warnings
2021-10-12 12:02:42 +01:00
Alex Orlenko
ed48b11e7f
Update documentation references
...
Using rustdoc links (see RFC https://github.com/rust-lang/rfcs/pull/1946 )
2021-10-12 00:49:45 +01:00
Alex Orlenko
259eb09ae1
v0.6.5
2021-10-05 18:11:32 +01:00
Alex Orlenko
a544e41b33
Add (hidden) method `UserData::take()` to take out value from userdata
2021-10-05 15:46:50 +01:00
Alex Orlenko
c8c64a1b5a
Add serializing i128/u128 types.
...
Fixes #81 .
2021-10-04 23:20:11 +01:00
Alex Orlenko
eff0bbb052
Add `Location::caller()` information to `Lua::load()` if chunk's name is None
2021-10-03 23:20:07 +01:00
Alex Orlenko
d098c9ccf6
Refactor Waker handling in async code.
...
Instead of storing `Option<Waker>` in the Lua registry, store it on the reference thread.
It gives approx +10% performance gain when calling async function.
2021-10-03 22:09:19 +01:00
Alex Orlenko
c62b17a5c8
Fixed bug when polling async futures ( #77 )
...
We expect first value returned via coroutine.yield() to be a special Pending type.
But instead we checked second value.
2021-10-02 07:23:24 +01:00
Alex Orlenko
584b377640
v0.6.4
2021-09-28 18:53:47 +01:00
Alex Orlenko
5b1483bd56
Change syntax of `protect_lua` macro
2021-09-28 18:47:08 +01:00
Alex Orlenko
a74b637ed4
Update check_stack requirements
2021-09-28 18:41:25 +01:00
Alex Orlenko
7623016d4a
Fix doc feature labels
2021-09-28 18:15:53 +01:00
Alex Orlenko
bdd3c923ba
Fix table traversal used in recursion detection.
...
This fixes serializing same table multiple times within a parent table.
2021-09-28 16:41:39 +01:00
Alex Orlenko
d586eef0f5
Refactor UserData metatables handling
2021-09-28 16:33:36 +01:00
Alex Orlenko
01154c0616
Minor refacor of wrapped failures cache
2021-09-28 16:27:24 +01:00
Alex Orlenko
e42d67c70d
Make `protect_lua` as a smart macro to choose from C/closure
2021-09-28 16:26:30 +01:00
Alex Orlenko
771a7775c5
Perf optimization: refactor metatable cache
2021-09-28 16:25:08 +01:00
Alex Orlenko
ee1c8a1a3d
Add inline attributes to few hot funcs
2021-09-28 16:19:29 +01:00
Alex Orlenko
3597e34ffb
Fix internal HookCallback type (missing optional Send)
2021-09-28 16:19:12 +01:00