Revert "lua: fix tuple cdata collecting"
This reverts commit 022a3c50. According to FFI documentation [1], ffi.cast() creates a new object for the given type and initializes it with the given value. So setting a finalizer for a tuple before casting it to const_tuple_ref_t is totally wrong as it allows the Lua interpreter to invoke the finalizer as soon as the cast is complete. That said, we must revert the commit that swapped ffi.cast and ffi.gc order in tuple_bless() and reopen the issue it intended to fix - see #3751 - no wonder it improved the garbage collector performance as it basically made all tuples collectable right from the moment they are blessed. To make sure we won't step on the same issue again in future, let's also add a relevant test case. [1] http://luajit.org/ext_ffi_api.html Closes #3902
Loading
Please register or sign in to comment