From mboxrd@z Thu Jan 1 00:00:00 1970 From: lm@mcvoy.com (Larry McVoy) Date: Sat, 12 Sep 2015 18:15:01 -0700 Subject: [TUHS] Did realloc ever zero the new memory? In-Reply-To: <201509130032.t8D0WvPl024634@tahoe.cs.Dartmouth.EDU> References: <201509130032.t8D0WvPl024634@tahoe.cs.Dartmouth.EDU> Message-ID: <20150913011501.GF2103@mcvoy.com> On Sat, Sep 12, 2015 at 08:32:57PM -0400, Doug McIlroy wrote: > It's odd that the later introduction of calloc() as a zeroing malloc() > has never been complemented by a similar variant of realloc(). That's a really good point. Anyone like these? void *alloc(size_t bytes); void *realloc(void *old, size_t want); void *zalloc(size_t bytes); void *zealloc(void *old, size_t want); So alloc is new, we can have that. Realloc() is OK? Or not? Does the current one have weird semantics? zalloc/zealloc are new, we can have those. If you guys like these I can push on Linus and the glibc people.