News for hackers. Stuff that matters.
Re:On the impossibility of composing finalizers and FFI by kevingadd on Tuesday February 27, 2024 @04:39AM (#39522075)
.NET calls this concept a 'dependent handle' if I understand you correctly, though allowing direct use of it is somewhat new:

https://learn.microsoft.com/en-us/dotnet/api/system.runtime....

And there's an older API that wraps them which I've found quite handy: https://learn.microsoft.com/en-us/dotnet/api/system.runtime....

Essentially, if you want to (externally - in code you wrote) associate two objects with each other without being able to modify the code of either of those objects, dependent handles are the ticket. It only creates a one-way liveness relationship, though, which may not be sufficient for every use case...

There are no comments on this comment yet.