diff options
| -rw-r--r-- | man3/malloc.3 | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/man3/malloc.3 b/man3/malloc.3 index c496f1714f..7bc74a3e56 100644 --- a/man3/malloc.3 +++ b/man3/malloc.3 @@ -23,8 +23,9 @@ .\" Modified Sat Jul 24 19:00:59 1993 by Rik Faith (faith@cs.unc.edu) .\" Clarification concerning realloc, iwj10@cus.cam.ac.uk (Ian Jackson), 950701 .\" Documented MALLOC_CHECK_, Wolfram Gloger (wmglo@dent.med.uni-muenchen.de) +.\" 2007-09-15 mtk: added notes on malloc()'s use of sbrk() and mmap(). .\" -.TH MALLOC 3 2007-07-25 "GNU" "Linux Programmer's Manual" +.TH MALLOC 3 2007-09-15 "GNU" "Linux Programmer's Manual" .SH NAME calloc, malloc, free, realloc \- Allocate and free dynamic memory .SH SYNOPSIS @@ -141,6 +142,28 @@ fails the original block is left untouched; it is not freed or moved. .SH "CONFORMING TO" C89, C99. .SH NOTES +Normally, +.BR malloc () +allocates memory from the heap, and adjusts the size of the heap +as required, using +.BR sbrk (2). +When allocating blocks of memory larger than +.B MMAP_THRESHOLD +bytes, the glibc +.BR malloc () +implementation allocates the memory as a private anonymous mapping using +.BR mmap (2). +.B MMAP_THRESHOLD +is 128 kB by default, but is adjustable using +.BR mallopt (3). +.\" FIXME -- there is no mallopt(3) man page yet. +Allocations performed using +.BR mmap (2) +are unaffected by the +.B RLIMIT_DATA +resource limit (see +.BR getrlimit (2)). + The Unix98 standard requires .BR malloc (), .BR calloc (), @@ -222,5 +245,7 @@ and .IR sysctl/vm.txt . .SH "SEE ALSO" .BR brk (2), +.\" .BR mallopt (3), +.BR mmap (2), .BR alloca (3), .BR posix_memalign (3) |
