There is no such thing as safe manual memory management, by definition manual memory management is unsafe.
Assuming you are defending Rust here, if the compiler, e.g. a tool, is doing validation of memory management, it is no longer manual.
As such I don't consider compiler verified memory management as manual.
> ... file that two threads are holding onto, which you want to close when both threads shut down
Easy, use a region and close the file when all threads join it. Let the thread runtime help the GC manage the resources.
Similar solutions can be applied to other types of resources.
There is no such thing as safe manual memory management, by definition manual memory management is unsafe.
Assuming you are defending Rust here, if the compiler, e.g. a tool, is doing validation of memory management, it is no longer manual.
As such I don't consider compiler verified memory management as manual.
> ... file that two threads are holding onto, which you want to close when both threads shut down
Easy, use a region and close the file when all threads join it. Let the thread runtime help the GC manage the resources.
Similar solutions can be applied to other types of resources.