From patchwork Thu Aug 15 09:38:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1147518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-104454-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="tEH0QYEm"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 468LxP1tlNz9sND for ; Thu, 15 Aug 2019 19:38:48 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= N64KXZ0htIBV0lK3l0lhfuvjw8wOZc/1WXO5JkGtp813cmAh+8XcAh9ZDVNaWx5i 3ksNEZPsxn+jE/O+APd0WtV2iWPFaFsI+AUAdU0SE9rnRUplloVT7196drTiWZKQ QcJ3ZtTgLREoPpxs40bLVW3RjA6MylQwcIFbLhSiUgg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=F+ODTp 8gnboMrpg/Obj7gUV6VVI=; b=tEH0QYEm0702l18JmuT03kArxyhqtLMuPeRn9B rmPcJjqCR5Un61TWP7VKKkWLmNWbC7HjaRfPjlluAGV4rGIxVIDLh31kPM3cIQZG ipMrfj1PRUmvtJaihvDCGBwERlsMm/8ZtweL5889eC14hL8+VTv+kdR67lE02YXi 9ZA8Q= Received: (qmail 102928 invoked by alias); 15 Aug 2019 09:38:43 -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 102912 invoked by uid 89); 15 Aug 2019 09:38:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=no X-HELO: mx1.redhat.com Date: Thu, 15 Aug 2019 11:38:38 +0200 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] malloc: Various cleanups for malloc/tst-mxfast User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20190815093838.6FE7C86302E6@oldenburg2.str.redhat.com> From: Florian Weimer 2019-08-15 Florian Weimer * malloc/Makefile (tests): Only add tst-mxfast for $(have-tunables). * malloc/tst-mxfast.c: Fix copyright year. (do_test): Fix GNU style issues. Use TEST_COMPARE instead of assert for checks. diff --git a/malloc/Makefile b/malloc/Makefile index 94b74b5c45..742c515eb2 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -39,7 +39,6 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ tst-malloc-too-large \ tst-malloc-stats-cancellation \ tst-tcfree1 tst-tcfree2 tst-tcfree3 \ - tst-mxfast \ tests-static := \ tst-interpose-static-nothread \ @@ -55,7 +54,7 @@ tests-internal += \ tst-dynarray-at-fail \ ifneq (no,$(have-tunables)) -tests += tst-malloc-usable-tunables +tests += tst-malloc-usable-tunables tst-mxfast tests-static += tst-malloc-usable-static-tunables endif diff --git a/malloc/tst-mxfast.c b/malloc/tst-mxfast.c index 7a371d2f9d..7a7750bc71 100644 --- a/malloc/tst-mxfast.c +++ b/malloc/tst-mxfast.c @@ -1,5 +1,5 @@ /* Test that glibc.malloc.mxfast tunable works. - Copyright (C) 2018, 2019 Free Software Foundation, Inc. + Copyright (C) 2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,14 +21,14 @@ the fast bins. */ #include -#include +#include int -do_test(void) +do_test (void) { struct mallinfo m; - char * volatile p1; - char * volatile p2; + char *volatile p1; + char *volatile p2; /* Arbitrary value; must be in default fastbin range. */ p1 = malloc (3); @@ -36,10 +36,10 @@ do_test(void) p2 = malloc (512); free (p1); - m = mallinfo(); + m = mallinfo (); /* This will fail if there are any blocks in the fastbins. */ - assert (m.smblks == 0); + TEST_COMPARE (m.smblks, 0); /* To keep gcc happy. */ free (p2);