c - Why calloc wasn't intended to assign arbitrary values? -


as per why malloc+memset slower calloc?

malloc+memset slower calloc under conditions.

why wasn't calloc written in such way can take value argument ( memset) override default assignment zero? have been effect of if done?

these calloc or memset initializations operate on byte level, memset value different 0 not usefull. @ least don't remember having used different values. allocate memory base type wider char.

the other aspect calloc initialization , not assignment. platforms may have builtins provide fast initialization of bytes 0, wouldn't capture when passing argument initialize.

but important aspect history of c. these interfaces originate beginning , impossible change.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -