This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][BZ #1128] Do not trim when arena is noncontiguous.


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]