Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Possibly, for small allocations: a possible way this can happen is a small-value `calloc()` inlined as a `malloc()` / store zeroes pair, and then the "store zeroes" part of that discarded by a later optimisation pass as a dead store.

On modern server/desktop/mobile CPUs, this won't make much difference anyway because the second write to the same location is essentially 'free' due to the store buffer.

And of course if you're calling calloc() in a tight loop, then the zeroing is the least of your performance concerns!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: