From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 10 22:43:12 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16A0716A41C for ; Fri, 10 Jun 2005 22:43:12 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id A98B943D1F for ; Fri, 10 Jun 2005 22:43:11 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j5AMgv9p045556; Fri, 10 Jun 2005 17:42:57 -0500 (CDT) (envelope-from dan) Date: Fri, 10 Jun 2005 17:42:57 -0500 From: Dan Nelson To: Mike Hunter Message-ID: <20050610224256.GG4116@dan.emsphone.com> References: <20050610224058.GA11336@malcolm.berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050610224058.GA11336@malcolm.berkeley.edu> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: freebsd-hackers@freebsd.org Subject: Re: unitialized memory is all zeros...why not garbage instead? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 22:43:12 -0000 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