[TUHS] Did realloc ever zero the new memory?

David david at kdbarto.org
Fri Sep 11 06:29:16 AEST 2015

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.


> 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 

More information about the TUHS mailing list