From df77455c4bae4518a76f2029bec5295e08c9e50b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 16 Apr 2009 21:22:16 +0000 Subject: [BZ #9957] 2009-04-16 Ulrich Drepper [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. --- malloc/hooks.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'malloc/hooks.c') 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; } } -- cgit 1.4.1