News for hackers. Stuff that matters.
Re:Why does calloc exist? by DannyBee on Tuesday December 06, 2016 @05:08AM (#13113528)
To give you a definite answer: Yes.

If you have a calloc, even along conditional paths, it will understand the value along that path is zero until the store, and that the zero is killed by the store.

What it will do varies, because it does not want to screw up the sparse memory usage.

But, for example, it even understands how to take the zero values + stores and turn them into a memset and kill the stores, etc.

It generally does not do something like split the allocation into a calloc and malloc+memset part, or whatever

There are no comments on this comment yet.