Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2005 17:42:57 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Mike Hunter <mhunter@ack.berkeley.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: unitialized memory is all zeros...why not garbage instead?
Message-ID:  <20050610224256.GG4116@dan.emsphone.com>
In-Reply-To: <20050610224058.GA11336@malcolm.berkeley.edu>
References:  <20050610224058.GA11336@malcolm.berkeley.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 10), Mike Hunter said:
> I have a feeling that I'm missing something really obvious, but I'm
> having trouble understanding why the following program:
> 
> int main (int argc, char * argv[])
> {
> 	void * ptr = malloc(65536);
> 
> Never prints anything but "0"'s.

The kernel zeros out memory before handing it to processes.

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050610224256.GG4116>