Re:On the impossibility of composing finalizers and FFI
by Joker_vD on Tuesday February 27, 2024 @05:40AM
(#39522477)
Okay, LuaJIT is a bit specific example, what about .NET CLR? Because it absolutely does this optimization, and e.g. an object can get GC'd while one of its instance methods is still running given that this instance method is statically (or maybe even dynamically?) guaranteed to not access `this`.
[ Parent
| on HN ]
Re:On the impossibility of composing finalizers and FFI
by epcoa on Tuesday February 27, 2024 @10:18AM
(#39525083)
Yes, and? It has mechanisms with well defined semantics such as GCHandle and KeepAlive. That’s literally what it is there for so it makes this: “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” a non starter.
It’s not a trick, it’s a documented interface.