3 ms·
It is not as you say. The article suggests that Malloc + Memset is slower than Calloc. Malloc will be faster depending on your use case. If your plan is to ev
by bcpermafrost 10y ago
It is not as you say.
The article suggests that Malloc + Memset is slower than Calloc.
Malloc will be faster depending on your use case. If your plan is to eventually call memset. Then just use Calloc, otherwise malloc will be faster all the time.
- Twirrim 10y agon00b question: Why would you not memset? I would assume you'd want to start with all zeroed memory in almost all cases.