Path: utzoo!news-server.csri.toronto.edu!rutgers!news.cs.indiana.edu!spool.mu.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: sbrk(2) question Message-ID: <6582@auspex.auspex.com> Date: 12 Mar 91 18:56:18 GMT References: <1991Mar8.180132.12025@Think.COM> <4296@skye.ed.ac.uk> Organization: Auspex Systems, Santa Clara Lines: 11 >There's one case where it amlost certainly won't be zero, which is when >memory has been previously alocated and released (eg by calling sbrk() >with a negative argument). So it's unwise to rely on it even if the >operating system allocates zeroed (or zero-fill-when-referenced) pages. Umm, why would it not be zero in that situation? If the memory has truly been released, as in "handed back to the kernel", it should be re-zeroed if allocated to a process again. (I.e., calling "sbrk()" with a negative argument, in most if not all versions of UNIX, doesn't just set some user-mode pointer so that the memory stays in the address space of the process.)