[TUHS] Did realloc ever zero the new memory?

Greg 'groggy' Lehey grog at lemis.com
Mon Sep 14 13:20:45 AEST 2015


On Sunday, 13 September 2015 at 16:09:55 +1000, Dave Horsfall wrote:
> On Sat, 12 Sep 2015, Larry McVoy wrote:
>
>> 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.
>
> I'll vote for those, although my dev days are pretty much over.  I've
> never liked malloc() etc not clearing memory, although it has been, ahem,
> useful, in the past...

http://xkcd.com/927/

Greg
--
Sent from my desktop computer.
Finger grog at FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft MUA reports
problems, please read http://tinyurl.com/broken-mua
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20150914/57cb0dda/attachment.sig>


More information about the TUHS mailing list