The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: david@kdbarto.org (David)
Subject: [TUHS] Did realloc ever zero the new memory?
Date: Thu, 10 Sep 2015 13:29:16 -0700	[thread overview]
Message-ID: <FF64BDD6-C57E-4959-B0D1-2F97FF909EA9@kdbarto.org> (raw)
In-Reply-To: <20150910202723.GI8154@mcvoy.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

I mentioned the /dev/zero malloc and, no, he was quite sure that it was realloc doing the zero fills.

Glad to know that I’m sitting on the right side of history on this one.

	David

> On Sep 10, 2015, at 1:27 PM, Larry McVoy <lm at mcvoy.com> wrote:
> 
> Good, glad to know it wasn't just me.  I've finally let my team use it
> but we avoided it when we supported more odd ball platforms.
> 
> On zero fill, I doubt many did that.  Many really early on when memory
> was small.
> 
> What you might be thinking of is modern systems implement malloc()
> as an mmap of /dev/zero and the initial data comes through as zeroed.
> But counting on that would be a mistake.
> 
> On Thu, Sep 10, 2015 at 01:22:33PM -0700, David wrote:
>> Buggy, sure.
>> 
>> Zero (less) filling, that is the question.
>> 
>> Realloc has had a difficult history, and I try to avoid it if at all possible.
>> 
>> 	David
>> 
>>> On Sep 10, 2015, at 1:21 PM, Larry McVoy <lm at mcvoy.com> wrote:
>>> 
>>> Am I the only one that remembers realloc() being buggy on some systems?
> 
> -- 
> ---
> Larry McVoy            	     lm at mcvoy.com             http://www.mcvoy.com/lm 




  reply	other threads:[~2015-09-10 20:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 19:52 David
2015-09-10 20:10 ` Jim Capp
2015-09-10 20:21   ` Larry McVoy
2015-09-10 20:22     ` David
2015-09-10 20:27       ` Larry McVoy
2015-09-10 20:29         ` David [this message]
2015-09-10 20:41     ` Clem Cole
2015-09-11  6:30       ` arnold
2015-09-11 14:36         ` Clem Cole
2015-09-11  0:13 ` Dave Horsfall
2015-09-11 15:41 Norman Wilson
2015-09-11 16:44 ` scj
     [not found] <1441931343.25526.for-standards-violators@oclsc.org>
2015-09-12  5:16 ` Dave Horsfall
2015-09-12  6:47   ` Greg 'groggy' Lehey
2015-09-13  0:32 Doug McIlroy
2015-09-13  1:15 ` Larry McVoy
2015-09-13  6:09   ` Dave Horsfall
2015-09-14  3:20     ` Greg 'groggy' Lehey
2015-09-17  4:42       ` Jonathan Gevaryahu
2015-09-13  7:06   ` markus schnalke
2015-09-13 10:32     ` Dave Horsfall
2015-09-13 11:06       ` markus schnalke
2015-09-13 12:13     ` Derek Fawcus
2015-09-13 13:45       ` John Cowan
2015-09-13  1:30 ` Random832
2015-09-13  2:29   ` Charles Anthony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FF64BDD6-C57E-4959-B0D1-2F97FF909EA9@kdbarto.org \
    --to=david@kdbarto.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).