lkml.org 
[lkml]   [2005]   [Jun]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 7 Jun 2005 01:53:19 -0700
FromUlrich Drepper <>
SubjectRe: Zeroed pages returned for heap
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-07 08:56    [W:0.263 / U:0.380 seconds]
©2003-2008 Jasper Spaans