From ac3ed168d0c0b2b702319ac0db72c9b475a8c72e Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 30 Aug 2017 19:29:38 +0200 Subject: malloc: Remove check_action variable [BZ #21754] Clean up calls to malloc_printerr and trim its argument list. This also removes a few bits of work done before calling malloc_printerr (such as unlocking operations). The tunable/environment variable still enables the lightweight additional malloc checking, but mallopt (M_CHECK_ACTION) no longer has any effect. --- malloc/arena.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'malloc/arena.c') diff --git a/malloc/arena.c b/malloc/arena.c index dc14fae152..39cbfbc282 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -215,8 +215,7 @@ void TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp) { int32_t value = (int32_t) valp->numval; - do_set_mallopt_check (value); - if (check_action != 0) + if (value != 0) __malloc_check_init (); } @@ -397,12 +396,8 @@ ptmalloc_init (void) } } } - if (s && s[0]) - { - __libc_mallopt (M_CHECK_ACTION, (int) (s[0] - '0')); - if (check_action != 0) - __malloc_check_init (); - } + if (s && s[0] != '\0' && s[0] != '0') + __malloc_check_init (); #endif #if HAVE_MALLOC_INIT_HOOK -- cgit v1.2.3