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 2a/1][BZ #12486] Remove assert in malloc statistic.


A bug https://sourceware.org/bugzilla/show_bug.cgi?id=12486 is nearly
duplicate of 11087.

A bugzilla contains patch that adds locking around calculating maxima.
As these asserts are almost useless for finding memory corruption a
second possibility is to disable them.

Comments?

	* malloc/malloc.c: remove checks for statistics.

diff --git a/malloc/malloc.c b/malloc/malloc.c
index 2938234..1a18c3f 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2216,15 +2216,6 @@ static void do_check_malloc_state(mstate av)
   /* top chunk is OK */
   check_chunk(av, av->top);
 
-  /* sanity checks for statistics */
-
-  assert(mp_.n_mmaps <= mp_.max_n_mmaps);
-
-  assert((unsigned long)(av->system_mem) <=
-	 (unsigned long)(av->max_system_mem));
-
-  assert((unsigned long)(mp_.mmapped_mem) <=
-	 (unsigned long)(mp_.max_mmapped_mem));
 }
 #endif
 


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