[TUHS] Did realloc ever zero the new memory?

Charles Anthony charles.unix.pro at gmail.com
Sun Sep 13 12:29:34 AEST 2015


On Sat, Sep 12, 2015 at 6:30 PM, Random832 <random832 at fastmail.com> wrote:

> Doug McIlroy <doug at 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.
>
>
Alignment perhaps?

-- Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20150912/3942e5af/attachment.html>


More information about the TUHS mailing list