3 ms·
If you want memory cleared on drop, you could do that by setting the global allocator to one that clears memory on free, rather than changing individual data st
by JoshTriplett 9y ago
If you want memory cleared on drop, you could do that by setting the global allocator to one that clears memory on free, rather than changing individual data structures.
- mehrdadn 9y agoI suspect he doesn't want to pay the performance penalty on all containers, just for a particular container.
- sitkack 9y agoAs noted elsewhere in this thread, one can implement a Drop trait the clears memory on deallocation. https://github.com/cesarb/clear_on_drop https://github.com/cesarb/clear_on_drop