aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-03-08 00:44:05 +0000
committerUlrich Drepper <drepper@redhat.com>2005-03-08 00:44:05 +0000
commita5a33449fb4b947c681968834b380cbc374018bb (patch)
tree16dac25d1ad7ef11a0828ce241f2da553c89841a /malloc
parent7511232436f31d007797c7d7bd4950e1d14842d2 (diff)
downloadglibc-a5a33449fb4b947c681968834b380cbc374018bb.zip
glibc-a5a33449fb4b947c681968834b380cbc374018bb.tar.gz
glibc-a5a33449fb4b947c681968834b380cbc374018bb.tar.bz2
(ptmalloc_init): Recognize MALLOC_PERTURB_ and call mallopt appropriately.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 8202aaf..8db2559 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -482,8 +482,13 @@ ptmalloc_init (void)
s = &envline[7];
break;
case 8:
- if (! secure && memcmp (envline, "TOP_PAD_", 8) == 0)
- mALLOPt(M_TOP_PAD, atoi(&envline[9]));
+ if (! secure)
+ {
+ if (memcmp (envline, "TOP_PAD_", 8) == 0)
+ mALLOPt(M_TOP_PAD, atoi(&envline[9]));
+ else if (memcmp (envline, "PERTURB_", 8) == 0)
+ mALLOPt(M_PERTURB, atoi(&envline[9]));
+ }
break;
case 9:
if (! secure && memcmp (envline, "MMAP_MAX_", 9) == 0)
@@ -510,6 +515,8 @@ ptmalloc_init (void)
mALLOPt(M_TRIM_THRESHOLD, atoi(s));
if((s = getenv("MALLOC_TOP_PAD_")))
mALLOPt(M_TOP_PAD, atoi(s));
+ if((s = getenv("MALLOC_PERTURB_")))
+ mALLOPt(M_PERTURB, atoi(s));
if((s = getenv("MALLOC_MMAP_THRESHOLD_")))
mALLOPt(M_MMAP_THRESHOLD, atoi(s));
if((s = getenv("MALLOC_MMAP_MAX_")))