[PATCH][BZ #1128] Do not trim when arena is noncontiguous.
Ondřej Bílka
neleai@seznam.cz
Mon Dec 9 15:34:00 GMT 2013
Hi,
When we call systrim we do not check if main arena is contiguous or not.
This can cause performance degradation like in bugzilla entry which can
be avoided by adding a check.
[BZ #1128]
* malloc/malloc.c (systrim): Do not trim when main arena is
noncontiguous.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index acfa9a2..ee98229 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2716,6 +2716,9 @@ static int systrim(size_t pad, mstate av)
size_t pagesz;
long top_area;
+ if (noncontiguous (av))
+ return 0;
+
pagesz = GLRO(dl_pagesize);
top_size = chunksize(av->top);
More information about the Libc-alpha
mailing list