3 ms·
On a related note, the OP says: > or attempt to manually extend the lifetime of a finalizable object, and then pray the compiler and GC don’t learn new tricks
by amluto 3y ago
On a related note, the OP says:
> or attempt to manually extend the lifetime of a finalizable object, and then pray the compiler and GC don’t learn new tricks to invalidate your trick.
This is also silly. There is no reason whatsoever that a GC can’t offer an actual API to keep an object alive.
- irq-1 3y agoLuaJIT lets you remove a finalizer: > An existing finalizer can be removed by setting a nil finalizer, e.g. right before explicitly deleting a resource: ffi.C.free(ffi.gc(p, nil)) -- Manually free the memory. https://luajit.org/ext_ffi_api.html#ffi_gc https://luajit.org/ext_ffi_api.html#ffi_gc