This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2a/1][BZ #12486] Remove assert in malloc statistic.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Thu, 17 Oct 2013 19:33:51 +0200
- Subject: [PATCH 2a/1][BZ #12486] Remove assert in malloc statistic.
- Authentication-results: sourceware.org; auth=none
- References: <20131017114140 dot GA24230 at domone dot podge>
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