6 ms·
calloc(3) isn't the only way to allocate memory, nor the most common one in ObjC apps.
by monocasa 4y ago
calloc(3) isn't the only way to allocate memory, nor the most common one in ObjC apps.
- astrange 4y agoActually, ObjC objects are allocated with calloc() so it might be the most common one. It also has a better interface than malloc() because it can check for overflow evaluating `size*count`, though it'd be even better if C had first-class types and you could pass that in.