about summary refs log tree commit diff
path: root/malloc/hooks.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-16 21:22:16 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-16 21:22:16 +0000
commitdf77455c4bae4518a76f2029bec5295e08c9e50b (patch)
tree3da4b0299a119ecccfd831021ab00a5b5bdfe20c /malloc/hooks.c
parent74b3cf224e48ce2a10cd70f5f3a911fc6f2718bc (diff)
downloadglibc-df77455c4bae4518a76f2029bec5295e08c9e50b.tar.gz
glibc-df77455c4bae4518a76f2029bec5295e08c9e50b.tar.xz
glibc-df77455c4bae4518a76f2029bec5295e08c9e50b.zip
[BZ #9957]
2009-04-16  Ulrich Drepper  <drepper@redhat.com>
	[BZ #9957]
	* malloc/malloc.c (force_reg): Define.
	(sYSMALLOc): Load hook variable into variable
	before test and force into register.
	(sYSTRIm): Likewise.
	(public_mALLOc): Force hook value into register.
	(public_fREe): Likewise.
	(public_rEALLOc): Likewise.
	(public_mEMALIGn): Likewise.
	(public_vALLOc): Likewise.
	(public_pVALLOc): Likewise.
	(public_cALLOc): Likewise.
	(__posix_memalign): Likewise.
	* malloc/arena.c (ptmalloc_init): Load hook variable into variable
	before test and force into register.
	* malloc/hooks.c (top_check): Likewise.
	(public_s_ET_STATe): Pretty printing.

	* resolv/res_send.c (send_dg): Don't just ignore the result we got
	in case we only receive one reply in single-request mode.
Diffstat (limited to 'malloc/hooks.c')
-rw-r--r--malloc/hooks.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/malloc/hooks.c b/malloc/hooks.c
index 72c29293d9..5360037a0d 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -235,8 +235,9 @@ top_check()
       return -1;
     }
   /* Call the `morecore' hook if necessary.  */
-  if (__after_morecore_hook)
-    (*__after_morecore_hook) ();
+  void (*hook) (void) = __after_morecore_hook;
+  if (hook)
+    (*hook) ();
   main_arena.system_mem = (new_brk - mp_.sbrk_base) + sbrk_size;
 
   top(&main_arena) = (mchunkptr)(brk + front_misalign);
@@ -669,10 +670,10 @@ public_sET_STATe(Void_t* msptr)
         !disallow_malloc_check)
       __malloc_check_init ();
     else if (!ms->using_malloc_checking && using_malloc_checking) {
-      __malloc_hook = 0;
-      __free_hook = 0;
-      __realloc_hook = 0;
-      __memalign_hook = 0;
+      __malloc_hook = NULL;
+      __free_hook = NULL;
+      __realloc_hook = NULL;
+      __memalign_hook = NULL;
       using_malloc_checking = 0;
     }
   }