Note that in debug builds the runtime already overwrites freed dynamic memory with `0xdd` bytes (which is even better than setting the memory to zero). I don't think the compiler does anything similar for automatic objects that go out of scope (though newer ones can fill uninitialized locals with `0xcc`) . There might be value in that, but it's unclear to me how much bang for buck you'd get.
↧