News for hackers. Stuff that matters.
Re:The Rust Calling Convention We Deserve by zozbot234 on Friday April 19, 2024 @02:15PM (#40090227)
> It's usually unwise to mix managed and unmanaged memory

Broadly stated, you can achieve this by marking a managed object as a GC root whenever it's to be referenced by unmanaged code (so that it won't be freed or moved in that case) and adding finalizers whenever managed objects own or hold refcounted references over unmanaged memory (so that the unmanaged code can reason about these objects being freed). But yes, it's a bit fiddly.

There are no comments on this comment yet.