From patchwork Wed Nov 14 00:00:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 30138 Received: (qmail 100069 invoked by alias); 14 Nov 2018 00:01:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 99943 invoked by uid 89); 14 Nov 2018 00:01:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Date: Tue, 13 Nov 2018 19:00:54 -0500 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org Subject: proposal: disable tcache when using malloc_check This is a fairly trivial change with significant side effects. The idea is that when one is using malloc_check (via tunables or environ) correctness and paranoia are favored over performance. Thus, as tcache bypasses all the malloc_check semantics, it should be disabled therein so that every malloc/free/etc get the full malloc_check treatment. Does anyone have any opinions for or against this idea? * malloc/hooks.c (__malloc_check_init): Disable tcache. diff --git a/malloc/hooks.c b/malloc/hooks.c index ae7305b036..16bca80202 100644 --- a/malloc/hooks.c +++ b/malloc/hooks.c @@ -61,6 +61,7 @@ __malloc_check_init (void) __free_hook = free_check; __realloc_hook = realloc_check; __memalign_hook = memalign_check; + do_set_tcache_count (0); } /* A simple, standard set of debugging hooks. Overhead is `only' one