]> sourceware.org Git - glibc.git/commitdiff
Remove references to sbrk to grow/shrink arenas
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Wed, 26 Oct 2016 09:37:07 +0000 (15:07 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Wed, 26 Oct 2016 09:37:07 +0000 (15:07 +0530)
The manual incorrectly references sbrk as the method used to grow and
shrink heaps and the fact that M_TRIM_THRESHOLD and M_TOP_PAD control
that behavior.  In reality, a heap may be grown or shrunk through
multiple methods depending on whether it is the main arena (in which
case sbrk is correct) or not (in which case, there are a number of
strategies including allocating an additional heap to grow an arena
and/or 'mprotect' a region to make it available for allocation).

Remove references to sbrk so that it covers the behavior more
accurately.

* manual/memory.texi (M_TOP_PAD): Remove reference to sbrk.
(M_TRIM_THRESHOLD): Likewise.

ChangeLog
manual/memory.texi

index 1b21469ee5d824dde00c9a100e20a4ffc2d74cb2..d9dc8491c98539ef28c26bda5b1a1350b2446212 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-10-26  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+       * manual/memory.texi (M_TOP_PAD): Remove reference to sbrk.
+       (M_TRIM_THRESHOLD): Likewise.
+
        * manual/memory.texi (M_ARENA_TEST): Add documentation.
        (M_ARENA_MAX): Likewise.
        * malloc/malloc.c: Remove obsolete comment.
index 4ad2c96393422ec3075d703199f877e01a98deed..b66de6021060d361849e2f3f1c1cd40895947439 100644 (file)
@@ -1132,11 +1132,10 @@ This parameter can also be set for the process at startup by setting the
 environment variable @env{MALLOC_MMAP_PERTURB_} to the desired value.
 
 @item M_TOP_PAD
-This parameter determines the amount of extra memory to obtain from the
-system when a call to @code{sbrk} is required.  It also specifies the
-number of bytes to retain when shrinking the heap by calling @code{sbrk}
-with a negative argument.  This provides the necessary hysteresis in
-heap size such that excessive amounts of system calls can be avoided.
+This parameter determines the amount of extra memory to obtain from the system
+when an arena needs to be extended.  It also specifies the number of bytes to
+retain when shrinking an arena.  This provides the necessary hysteresis in heap
+size such that excessive amounts of system calls can be avoided.
 
 The default value of this parameter is @code{0}.
 
@@ -1145,8 +1144,7 @@ environment variable @env{MALLOC_TOP_PAD_} to the desired value.
 
 @item M_TRIM_THRESHOLD
 This is the minimum size (in bytes) of the top-most, releasable chunk
-that will cause @code{sbrk} to be called with a negative argument in
-order to return memory to the system.
+that will trigger a system call in order to return memory to the system.
 
 If this parameter is not set, the default value is set as 128 KiB and the
 threshold is adjusted dynamically to suit the allocation patterns of the
This page took 0.192574 seconds and 5 git commands to generate.