public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@gmail.com>
To: "Tomar, Nagendra" <nagendra_tomar@adaptec.com>
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: Zeroed pages returned for heap
Date: Tue, 7 Jun 2005 01:53:19 -0700	[thread overview]
Message-ID: <a36005b505060701531a545ba4@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0506070936530.4569-100000@localhost.localdomain>

On 6/6/05, Nagendra Singh Tomar <nagendra_tomar@adaptec.com> wrote:
> Is it OK for an application (a C library implementing malloc/calloc is
> also an application) to assume that the pages returned by the OS for heap
> allocation (either directly thru brk() or thru mmap(MAP_ANONYMOUS)) will
> be zero filled.

The malloc code is glibc is defined with the assumption that brk
clears memory.  Since this is what the kernel implements it would be a
horrible waste of time to reinitialize the memory.  This behavior is
part of the kernel ABI and cannot be changed without breaking existing
applications without producing new libc DSOs (set MORECORE_CLEARS
appropriately) and relinking all statically linked apps.

  reply	other threads:[~2005-06-07  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07  4:23 Zeroed pages returned for heap Nagendra Singh Tomar
2005-06-07  8:53 ` Ulrich Drepper [this message]
2005-06-07  9:59   ` Nagendra Singh Tomar
2005-06-07 15:57 ` Peter Staubach
2005-06-08  4:08   ` Nagendra Singh Tomar
2005-06-09 10:14     ` Richard B. Johnson
2005-06-10  4:06       ` Nagendra Singh Tomar

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=a36005b505060701531a545ba4@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nagendra_tomar@adaptec.com \
    /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