mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-10 19:30:10 +00:00
(ptmalloc_init): Recognize MALLOC_PERTURB_ and call mallopt appropriately.
This commit is contained in:
parent
7511232436
commit
a5a33449fb
@ -482,8 +482,13 @@ ptmalloc_init (void)
|
|||||||
s = &envline[7];
|
s = &envline[7];
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (! secure && memcmp (envline, "TOP_PAD_", 8) == 0)
|
if (! secure)
|
||||||
|
{
|
||||||
|
if (memcmp (envline, "TOP_PAD_", 8) == 0)
|
||||||
mALLOPt(M_TOP_PAD, atoi(&envline[9]));
|
mALLOPt(M_TOP_PAD, atoi(&envline[9]));
|
||||||
|
else if (memcmp (envline, "PERTURB_", 8) == 0)
|
||||||
|
mALLOPt(M_PERTURB, atoi(&envline[9]));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
if (! secure && memcmp (envline, "MMAP_MAX_", 9) == 0)
|
if (! secure && memcmp (envline, "MMAP_MAX_", 9) == 0)
|
||||||
@ -510,6 +515,8 @@ ptmalloc_init (void)
|
|||||||
mALLOPt(M_TRIM_THRESHOLD, atoi(s));
|
mALLOPt(M_TRIM_THRESHOLD, atoi(s));
|
||||||
if((s = getenv("MALLOC_TOP_PAD_")))
|
if((s = getenv("MALLOC_TOP_PAD_")))
|
||||||
mALLOPt(M_TOP_PAD, atoi(s));
|
mALLOPt(M_TOP_PAD, atoi(s));
|
||||||
|
if((s = getenv("MALLOC_PERTURB_")))
|
||||||
|
mALLOPt(M_PERTURB, atoi(s));
|
||||||
if((s = getenv("MALLOC_MMAP_THRESHOLD_")))
|
if((s = getenv("MALLOC_MMAP_THRESHOLD_")))
|
||||||
mALLOPt(M_MMAP_THRESHOLD, atoi(s));
|
mALLOPt(M_MMAP_THRESHOLD, atoi(s));
|
||||||
if((s = getenv("MALLOC_MMAP_MAX_")))
|
if((s = getenv("MALLOC_MMAP_MAX_")))
|
||||||
|
Loading…
Reference in New Issue
Block a user