This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] malloc: remove hooks from malloc() and free()
- From: Joern Engel <joern at purestorage dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Joern Engel <joern at purestorage dot com>
- Date: Mon, 25 Jan 2016 16:25:35 -0800
- Subject: [PATCH] malloc: remove hooks from malloc() and free()
- Authentication-results: sourceware.org; auth=none
- References: <1453767942-19369-1-git-send-email-joern at purestorage dot com>
Apparently these hooks are not needed on our systems. They cost a
significant bit of performance when present. And most importantly, they
cause failures including memory corruptions in stress tests.
A much larger change that we should do eventually is removing all hooks
throughout malloc.
JIRA: PURE-27597
---
tpc/malloc2.13/malloc.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/tpc/malloc2.13/malloc.c b/tpc/malloc2.13/malloc.c
index 2427fae19b39..c4e3fbada60a 100644
--- a/tpc/malloc2.13/malloc.c
+++ b/tpc/malloc2.13/malloc.c
@@ -3290,10 +3290,6 @@ Void_t *public_mALLOc(size_t bytes)
struct malloc_state *ar_ptr;
Void_t *victim;
- __malloc_ptr_t(*hook) (size_t, __const __malloc_ptr_t) = force_reg(dlmalloc_hook);
- if (hook != NULL)
- return (*hook) (bytes, RETURN_ADDRESS(0));
-
victim = tcache_malloc(bytes);
if (victim)
return victim;
@@ -3315,12 +3311,6 @@ void public_fREe(Void_t * mem)
{
mchunkptr p; /* chunk corresponding to mem */
- void (*hook) (__malloc_ptr_t, __const __malloc_ptr_t) = force_reg(dlfree_hook);
- if (hook != NULL) {
- (*hook) (mem, RETURN_ADDRESS(0));
- return;
- }
-
if (mem == 0) /* free(0) has no effect */
return;
--
2.7.0.rc3