The calloc
function in C is used to allocate zeroed memory capable of holding at least the requested amount of elements of a specified size. In practice, most memory allocators may allocate a bigger block in order to increase efficiency and minimize fragmentation. The actual usable block size of an allocation in such systems is usually discoverable by means of special functions, i.e. _msize
or malloc_usable_size
.
Will calloc
make sure the entire usable block is zeroed, or will it only zero the requested count*size part of the allocation?