Commit Graph

  • 066d28f5e5 Update Lua::unload doc & fix clippy warnings Alex Orlenko 2021-11-23 18:34:57 +00:00
  • 4528f93345 Merge pull request #103 from polachok/unload Alex Orlenko 2021-11-23 18:11:13 +00:00
  • d49757c7db Add unload() to remove module Alexander Polakov 2021-11-23 18:20:54 +03:00
  • 170818c469 Add call() function to TableExt to call tables with __call metamethod as functions Alex Orlenko 2021-11-21 23:47:45 +00:00
  • 55c8af1e6b Add minimum Rust requirements to README Alex Orlenko 2021-11-18 18:46:05 +00:00
  • e2ebe65306 Add get_named_user_value and set_named_user_value to AnyUserData Alex Orlenko 2021-11-18 17:52:43 +00:00
  • f0f5a8a0af Update CHANGELOG Alex Orlenko 2021-11-17 23:41:30 +00:00
  • 0e1be19cbb Move hook_proc under Lua::set_hook to use callback_error_ext Alex Orlenko 2021-11-16 12:27:56 +00:00
  • 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) Alex Orlenko 2021-11-16 00:08:13 +00:00
  • 41503b4fb8 Update callback_error_ext (+ fix callback multi states handling) Alex Orlenko 2021-11-15 13:47:15 +00:00
  • 19bd254e1e Update comments Alex Orlenko 2021-11-14 23:27:20 +00:00
  • 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. Alex Orlenko 2021-11-14 12:57:49 +00:00
  • 7efe807199 Include StdLib to prelude Alex Orlenko 2021-11-14 12:46:08 +00:00
  • 63ea8c7662 Rename wrapped_failures pool to cache Alex Orlenko 2021-11-14 11:22:21 +00:00
  • 863d36d5a1 Performance optimization: cache and reuse MultiValue containers Alex Orlenko 2021-11-12 15:32:53 +00:00
  • a8017c10b9 Update callback_error(_ext) Alex Orlenko 2021-11-12 12:41:03 +00:00
  • 2c7d7117d2 Optimize MultiValue allocations (recycle old container) Alex Orlenko 2021-11-12 10:55:20 +00:00
  • 6d689c35aa Update hook::Debug struct Alex Orlenko 2021-11-09 18:20:26 +00:00
  • 8af1304fd0 Add Lua::inspect_stack to get information about the interpreter runtime stack. This functionality is provided by lua_getstack. Alex Orlenko 2021-11-09 13:41:10 +00:00
  • 153502ec73 Add set_nth_user_value and get_nth_user_value to AnyUserData with n up to 65535 for all Lua versions. Alex Orlenko 2021-11-08 21:16:31 +00:00
  • 2ea2b1f4fb Refactor Error::CallbackError reporting and include source to fmt::Display implementation. This fixes #71. Alex Orlenko 2021-11-07 21:21:50 +00:00
  • ef8c1556e6 Add optional Send to Lua::app_data Alex Orlenko 2021-11-07 15:03:17 +00:00
  • b0da2fc439 Switch Table::serialize to FxHashSet Alex Orlenko 2021-11-07 14:49:19 +00:00
  • 204eedde3c Merge branch 'dev' Alex Orlenko 2021-11-07 13:07:22 +00:00
  • fbc2973aff Fix recursive tables serialization when using serde::ser::Serialize implementation for Table. Fixes #98. Alex Orlenko 2021-11-06 21:12:00 +00:00
  • d0641d812f Refactor a bit conversion int->number Alex Orlenko 2021-11-04 13:15:26 +00:00
  • ad70ba54a5 Publish AnyUserData::take Alex Orlenko 2021-11-04 12:32:19 +00:00
  • 806f0bcef4 Add luajit52 support (LuaJIT with partial compatibility with Lua 5.2) Alex Orlenko 2021-11-04 12:25:20 +00:00
  • 0741db7565 Make (De)SerializeOptions as const Alex Orlenko 2021-11-04 01:07:38 +00:00
  • d88a4282c7 Replace macro-based implementation ToLua for arrays to const generics Alex Orlenko 2021-11-04 00:59:19 +00:00
  • d7d987fa14 Add async meta methods for all Lua except 51 Alex Orlenko 2021-09-26 00:37:32 +01:00
  • 4d3ac6d8c5 Add new "application data" api Alex Orlenko 2021-09-21 00:26:48 +01:00
  • a9ca99349c Switch to FxHash Alex Orlenko 2021-09-20 13:42:48 +01:00
  • f71db80a74 Change definition of lua_State to opaque struct Alex Orlenko 2021-08-27 14:43:25 +01:00
  • 09af3e021a v0.6.6 v0.6.6 Alex Orlenko 2021-10-12 12:21:28 +01:00
  • 9e3d495f91 Calculate coverage for Lua 5.4 instead of Lua 5.3 Alex Orlenko 2021-10-12 12:10:01 +01:00
  • cab2e5a48e Fix clippy warnings Alex Orlenko 2021-10-12 12:02:42 +01:00
  • 25a4879cde Update examples: async_http_client/async_http_server/async_tcp_server Make them following best practices and remove unsafe code. Alex Orlenko 2021-10-12 11:55:25 +01:00
  • ed48b11e7f Update documentation references Using rustdoc links (see RFC https://github.com/rust-lang/rfcs/pull/1946) Alex Orlenko 2021-10-11 22:43:33 +01:00
  • 559f9e6c6b Add target.aarch64-apple-darwin conf to module examples Alex Orlenko 2021-10-11 18:07:34 +01:00
  • 458b06796c Fixed LUA_REGISTRYINDEX when generating glue.rs on cross-compiling for lua51(jit) Alex Orlenko 2021-10-08 20:57:19 +01:00
  • 259eb09ae1 v0.6.5 v0.6.5 Alex Orlenko 2021-10-04 23:29:20 +01:00
  • a544e41b33 Add (hidden) method UserData::take() to take out value from userdata Alex Orlenko 2021-10-05 13:04:43 +01:00
  • 235fba821e Update CHANGELOG Alex Orlenko 2021-10-04 23:28:24 +01:00
  • c8c64a1b5a Add serializing i128/u128 types. Fixes #81. Alex Orlenko 2021-10-04 23:20:11 +01:00
  • eff0bbb052 Add Location::caller() information to Lua::load() if chunk's name is None Alex Orlenko 2021-10-03 23:16:08 +01:00
  • 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. Alex Orlenko 2021-10-03 21:21:53 +01:00
  • 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. Alex Orlenko 2021-10-02 07:23:24 +01:00
  • 584b377640 v0.6.4 v0.6.4 Alex Orlenko 2021-09-28 18:53:47 +01:00
  • 1141073a65 Update CHANGELOG Alex Orlenko 2021-09-28 18:51:27 +01:00
  • 5b1483bd56 Change syntax of protect_lua macro Alex Orlenko 2021-09-28 18:47:08 +01:00
  • a74b637ed4 Update check_stack requirements Alex Orlenko 2021-09-28 18:41:25 +01:00
  • 7623016d4a Fix doc feature labels Alex Orlenko 2021-09-28 18:15:53 +01:00
  • bdd3c923ba Fix table traversal used in recursion detection. This fixes serializing same table multiple times within a parent table. Alex Orlenko 2021-09-28 16:10:09 +01:00
  • d586eef0f5 Refactor UserData metatables handling Alex Orlenko 2021-09-26 01:05:37 +01:00
  • 01154c0616 Minor refacor of wrapped failures cache Alex Orlenko 2021-09-20 20:47:22 +01:00
  • e42d67c70d Make protect_lua as a smart macro to choose from C/closure Alex Orlenko 2021-07-07 12:54:19 +01:00
  • 771a7775c5 Perf optimization: refactor metatable cache Alex Orlenko 2021-09-20 14:08:43 +01:00
  • ee1c8a1a3d Add inline attributes to few hot funcs Alex Orlenko 2021-09-20 12:38:08 +01:00
  • 3597e34ffb Fix internal HookCallback type (missing optional Send) Alex Orlenko 2021-09-20 12:13:36 +01:00
  • 35eedd5a5e v0.6.3 v0.6.3 Alex Orlenko 2021-09-16 00:55:49 +01:00
  • 53f873a482 Update compile tests error messages Alex Orlenko 2021-09-16 00:49:17 +01:00
  • fc1fe2c15e Add DeserializeOptions struct to control deserializer behavior. This solves #74 and provides a way to deserialize a Lua globals table. Alex Orlenko 2021-09-15 23:37:30 +01:00
  • 7e7a44f4cd Update CHANGELOG Alex Orlenko 2021-08-22 16:31:14 +01:00
  • 63c4861520 Create FUNDING.yml Alex Orlenko 2021-08-22 16:22:20 +01:00
  • 27e7facf9b Fix clippy warnings Alex Orlenko 2021-08-22 00:01:17 +01:00
  • 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. Alex Orlenko 2021-08-21 23:17:09 +01:00
  • 7d1b322e18 Change ExtraData::mem_info to Box<MemoryInfo> Alex Orlenko 2021-08-19 01:42:32 +01:00
  • d906405818 Simplify interface of hook::HookTriggers Alex Orlenko 2021-08-18 18:49:17 +01:00
  • 60fd060d47 Clarify about calling Lua::init_from_ptr() multiple times Alex Orlenko 2021-08-17 15:34:34 +01:00
  • 9f02a9ca09 Add Debug::event() to the hook's Debug structure Alex Orlenko 2021-08-17 15:17:03 +01:00
  • 1d7f105585 Don't catch Rust panics in userdata finalizer on drop Alex Orlenko 2021-08-06 11:14:16 +01:00
  • 1020315a9b Update documentation about FromLua for UserData. Closes #64 Alex Orlenko 2021-08-04 12:12:02 +01:00
  • 628b70f561 v0.6.2 v0.6.2 Alex Orlenko 2021-07-13 20:29:25 +01:00
  • 8a7e546c66 Shrink unsafe block in Lua::load_from_function and update doc Alex Orlenko 2021-07-13 16:03:50 +01:00
  • 97bd288f56 Add CI tests with enabled address sanitizer Don't use release mode in tests Try to use cache in CI Alex Orlenko 2021-07-13 12:14:34 +01:00
  • 59253410bb Update trybuild messages Alex Orlenko 2021-07-13 11:59:33 +01:00
  • 5fb7b96704 Replace custom UserDataRef(Mut) with standard Ref(Mut) Alex Orlenko 2021-07-13 10:53:10 +01:00
  • 17162b1e0b UserData improvements: 1) Optimize make_userdata call 2) Refactor UserDataWrapped and make it enum Alex Orlenko 2021-07-10 22:45:32 +01:00
  • 934aa3b65f Forgotten optimization for box_method_mut Alex Orlenko 2021-07-09 23:25:48 +01:00
  • 3bffe1d7c3 Combine WrappedError and WrappedPanic structs to WrappedFailure enum Alex Orlenko 2021-07-09 00:05:29 +01:00
  • 582b2c585f Rename init_gc_metatable_for and get_gc_metatable_for Alex Orlenko 2021-07-08 22:57:54 +01:00
  • 56b6b128b5 Minor fixes/compilation after revert Alex Orlenko 2021-07-08 22:53:53 +01:00
  • 1731f5d61b Revert "Make protect_lua as a smart macro to choose from C/closure" Alex Orlenko 2021-07-08 18:41:10 +01:00
  • 60822d12d2 Revert "Move away from metatable hashmap cache to direct keys" Alex Orlenko 2021-07-08 18:40:14 +01:00
  • 8ff610529b Don't wrap ExtraData to Arc<Mutex> and use raw pointer instead. This causes serious performance issues and given that Lua is single threaded (not Sync) it's safe to use a raw pointer instead. Alex Orlenko 2021-07-08 17:32:20 +01:00
  • adbc9ccc9b Move away from metatable hashmap cache to direct keys Alex Orlenko 2021-07-08 15:37:18 +01:00
  • 84fe5f7f76 Make protect_lua as a smart macro to choose from C/closure Alex Orlenko 2021-07-07 12:54:19 +01:00
  • 1fe583027b Add new functions: lua.load_from_function() and lua.create_c_function() This should be useful to register embedded C modules to Lua state. Provides a solution for #61 Alex Orlenko 2021-07-04 23:51:51 +01:00
  • 7b5b78fa3d Add codecov.yml to don't fail on coverage change Alex Orlenko 2021-06-30 21:52:50 +01:00
  • 41aae83304 Optimize callback creation Attach only one upvalue to callbacks rather than two. This leads to less lookup to Lua registry. Alex Orlenko 2021-06-30 16:50:50 +01:00
  • fc84e8623e v0.6.1 v0.6.1 Alex Orlenko 2021-06-27 22:42:14 +01:00
  • 8aae9a7c3e Update chunk! documentation Alex Orlenko 2021-06-26 23:41:21 +01:00
  • 24bbd62564 Fix converting Lua sequence table to HashSet/BTreeSet Alex Orlenko 2021-06-25 01:49:09 +01:00
  • 30af919931 Lower once_cell dependency to 1.0 Alex Orlenko 2021-06-25 00:39:10 +01:00
  • 89b5981c59 Fix typos Alex Orlenko 2021-06-25 00:38:49 +01:00
  • 7feabffc37 v0.6.0 v0.6.0 Alex Orlenko 2021-06-21 23:19:56 +01:00
  • f24fdfdb80 Update AsChunk::env function prototype Alex Orlenko 2021-06-21 23:19:33 +01:00
  • c702c5eff2 Add userdata example Alex Orlenko 2021-06-21 20:28:14 +01:00
  • e4daff8c16 Add limited recursion test to increase coverage Alex Orlenko 2021-06-21 12:18:06 +01:00