27 Commits

Author SHA1 Message Date
Alex Orlenko 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`
2023-07-06 00:38:33 +01:00
Alex Orlenko aaf0a5e44a Remove usage of crate::ffi (clippy) 2023-04-14 00:36:31 +01:00
Alex Orlenko 288934c82c Refactor HookTriggers (make it const) 2023-04-05 01:02:27 +01:00
Alex Orlenko b790b525c1 Fix clippy warnings 2023-02-07 22:43:48 +00:00
Alex Orlenko 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`)
2022-12-19 16:09:05 +00:00
Alex Orlenko 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
2022-12-09 23:55:38 +00:00
Alex Orlenko 29c6c9cb58 Fix clippy warnings 2022-10-09 14:08:33 +01:00
Alex Orlenko e523fb2c86 Update to Luau 0.548 (luau-src >=0.4) 2022-10-08 23:34:47 +01:00
Alex Orlenko 5133a9837a Add Function::info() to get information about functions.
Closes #149 and #7.
2022-04-18 18:28:11 +01:00
Alex Orlenko ec1fa04085 Update docs 2022-03-25 00:43:54 +00:00
Alex Orlenko 3e5f8e7bb8 Enable Lua::inspect_stack for Luau 2022-03-21 01:08:47 +00:00
Alex Orlenko 2fee3e7891 Update docs 2021-11-25 18:01:41 +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 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 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 31d32f2dda Wrap ExtraData to Arc<UnsafeCell>> instead of raw pointer and attach finalizer.
This would allow to properly deallocate memory in module mode when closing lua state.
2021-08-21 23:17:09 +01:00
Alex Orlenko d906405818 Simplify interface of hook::HookTriggers 2021-08-18 18:49:17 +01:00
Alex Orlenko 9f02a9ca09 Add Debug::event() to the hook's Debug structure 2021-08-17 15:17:03 +01:00
Alex Orlenko d3f44354e0 Revert commit ced808d5ab
I think this experiment is unsuccessful and does not work well in a module mode
with dynamic symbols resolution and mixing between different mlua instances.
Overall the Rust bug has been fixed and we can wait for the "C-unwind" feature become stable.
2021-06-16 22:13:01 +01:00
Alex Orlenko e8de2a458a Allow multiple entrypoints in a single module share the same Lua state.
Previously it would initialize different Lua instances.
Fixes #49.
2021-05-18 20:07:34 +01:00
Alex Orlenko 0bad4a0ff9 Fix spelling 2021-05-10 19:53:38 +01:00
Alex Orlenko 3f55958bdd Stack assertions review
Other minor code and documentation updates
2021-05-02 11:42:03 +01:00
Alex Orlenko ced808d5ab Don't trigger longjmp in rust.
Motivation behind this change is upcoming breaking change in Rust
compiler v1.52.0 to prevent unwinding across FFI boundaries.
https://github.com/rust-lang/rust/pull/76570
The new functionality requires nightly compiler to declare FFI
functions as "C-unwind".
The fundamental solution is to use C shim to wrap "e" and "m"
Lua functions in pcall.
Additionally define Rust calling convention to trigger lua_error
on Rust behalf.
2021-04-27 00:29:38 +01:00
Alex Orlenko 6e2b687cb7 Serde support (serialize feature flag) 2020-12-14 00:51:26 +00:00
Alex Orlenko efcaef3db7 Enable hooks support for LuaJIT 2020-06-07 20:38:19 +01:00
Alex Orlenko c3822219e0 Add hooks support (based on rlua v0.17 implementation)
This feature works on lua54, lua53, lua52 and lua51 only.
LuaJIT is unstable.
2020-06-06 16:07:16 +01:00