This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
[PATCH] * malloc/malloc.c: Don't handle mmapped chunks in _int_free. All callers already take care of mmapped chunks.
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: libc-help at sourceware dot org
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- Date: Thu, 17 Feb 2011 17:43:46 +0530
- Subject: [PATCH] * malloc/malloc.c: Don't handle mmapped chunks in _int_free. All callers already take care of mmapped chunks.
Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
---
malloc/malloc.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 3e06b87..c97f155 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4904,7 +4904,11 @@ _int_free(mstate av, mchunkptr p)
Consolidate other non-mmapped chunks as they arrive.
*/
+#if 0
else if (!chunk_is_mmapped(p)) {
+#else
+ assert (!chunk_is_mmapped(p));
+#endif
#ifdef ATOMIC_FASTBINS
if (! have_lock) {
# if THREAD_STATS
@@ -5055,6 +5059,7 @@ _int_free(mstate av, mchunkptr p)
(void)mutex_unlock(&av->mutex);
}
#endif
+#if 0
}
/*
If the chunk was allocated via mmap, release via munmap(). Note
@@ -5069,6 +5074,7 @@ _int_free(mstate av, mchunkptr p)
munmap_chunk (p);
#endif
}
+#endif
}
/*
--
1.7.3.4