Hacker News new | ask | show | jobs
by flyx86 3511 days ago
For safe resource finalization, Ada provides `Ada.Finalization.Controlled`. This enables you to implement RAII, smart pointers, and other ways of safe finalization. `Ada.Unchecked_Deallocation` is just the bare-metal tool you can implement more intelligent finalization with (because in the end, someone needs to deallocate the memory).
1 comments

Without substructural types, no matter how much lipstick you put on the pig, use after free will always be possible.