4 ms·
Calloc sometimes doesn't really do this. I believe on some architectures (like Linux) it requests the page and sets a traps so that it only fills with zeros wh
by throwawaymaths 3y ago
Calloc sometimes doesn't really do this. I believe on some architectures (like Linux) it requests the page and sets a traps so that it only fills with zeros when you first access segments of the memory space. This winds up being much better for cache coherency if you're doing something that runs across the memory space.