This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][BZ #1128] Do not trim when arena is noncontiguous.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Mon, 9 Dec 2013 15:57:44 +0100
- Subject: [PATCH][BZ #1128] Do not trim when arena is noncontiguous.
- Authentication-results: sourceware.org; auth=none
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);