4 ms·
One advantage is that when you allocate the memory back out (either by malloc, or calloc which requires zeroing), you don't have to do anything. It is mentione
by CJefferson 4y ago
One advantage is that when you allocate the memory back out (either by malloc, or calloc which requires zeroing), you don't have to do anything.
It is mentioned that if you write to freed memory, that could lead to later callocs not returning zeroed memory, which shows they are relying on this.
- mcculley 4y agoYeah, if performance is the goal, zero is certainly faster. I have used 0xDEADBEEF to find both free-after-use and use-before-initialize bugs.