Doug McIlroy <doug(a)cs.dartmouth.edu> writes:
It's odd that the later introduction of calloc()
as a zeroing malloc()
has never been complemented by a similar variant of realloc().
Speaking of calloc, was it ever envisioned that any implementation would
do anything more sophisticated with the two arguments than multiply them
together (and detect overflow)? Has any such implementation ever
existed? It seems like one of the great mysteries of the C library
design, especially since early implementations didn't do overflow
checking.
The existence of cfree also suggests an intention to eventually have it
use a separate arena from malloc.