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] malloc: remove hooks from malloc() and free()


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


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