From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 533431F8C6 for ; Wed, 28 Jul 2021 08:18:55 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D0AC398B870 for ; Wed, 28 Jul 2021 08:18:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D0AC398B870 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627460334; bh=lLZTI5e/eYcoqsGPyJ4iCGb84lJW2g3AfP5+Cb6f48U=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=K+bmrwRDIlpLgsontFPT1YS7poK58XwQZrE5PQ18X6T0GV++1KM9Z8rK2PPhBLZlL sVRU3hUluvIotUrS5jBkuWhIziojlVxeNQSoMCnKxSR9qrE8eWLpup6FVsrXq1wa+h dirbY5IDXmSDDZI/rRHsXA7vWxkMbiu0F8sqDDnY= Received: from black.elm.relay.mailchannels.net (black.elm.relay.mailchannels.net [23.83.212.19]) by sourceware.org (Postfix) with ESMTPS id 4DFCE3988421 for ; Wed, 28 Jul 2021 07:32:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DFCE3988421 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CCD8E401785; Wed, 28 Jul 2021 07:32:10 +0000 (UTC) Received: from pdx1-sub0-mail-a75.g.dreamhost.com (100-96-133-125.trex.outbound.svc.cluster.local [100.96.133.125]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 07BA6402429; Wed, 28 Jul 2021 07:32:10 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a75.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.133.125 (trex/6.3.3); Wed, 28 Jul 2021 07:32:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Industry-Lonely: 4945e6e120e713a9_1627457530256_3756328553 X-MC-Loop-Signature: 1627457530256:1499319842 X-MC-Ingress-Time: 1627457530256 Received: from pdx1-sub0-mail-a75.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a75.g.dreamhost.com (Postfix) with ESMTP id B79388C382; Wed, 28 Jul 2021 00:32:09 -0700 (PDT) Received: from [192.168.1.143] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a75.g.dreamhost.com (Postfix) with ESMTPSA id BF4DA8C377; Wed, 28 Jul 2021 00:32:06 -0700 (PDT) Subject: Re: [PATCH] tests: use xmalloc to allocate implementation array To: Florian Weimer , Siddhesh Poyarekar via Libc-alpha References: <20210728052841.3889012-1-siddhesh@sourceware.org> <87im0uaoig.fsf@oldenburg.str.redhat.com> X-DH-BACKEND: pdx1-sub0-mail-a75 Message-ID: Date: Wed, 28 Jul 2021 13:01:59 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87im0uaoig.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Siddhesh Poyarekar via Libc-alpha Reply-To: Siddhesh Poyarekar Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 7/28/21 12:55 PM, Florian Weimer wrote: > * Siddhesh Poyarekar via Libc-alpha: > >> diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h >> index fd25264417..03de372cff 100644 >> --- a/benchtests/bench-string.h >> +++ b/benchtests/bench-string.h >> @@ -18,6 +18,7 @@ >> >> #include >> #include >> +#include >> >> /* We are compiled under _ISOMAC, so libc-symbols.h does not do this >> for us. */ >> @@ -200,8 +201,8 @@ static impl_t *impl_array; >> skip = impl; \ >> else \ >> impl_count++; \ >> - a = impl_array = malloc ((impl_count + func_count) * \ >> - sizeof (impl_t)); \ >> + a = impl_array = xmalloc ((impl_count + func_count) * \ >> + sizeof (impl_t)); \ >> for (impl = __start_impls; impl < __stop_impls; ++impl) \ >> if (impl != skip) \ >> *a++ = *impl; \ > > I'm surprised the benchtests link against libsupport. There's some > non-trivial setup code involved in libsupport for failure handling, and > that gets linked into xmalloc. It might affect the benchmarks. Yeah, it may not hurt to wean them away; it's really just the string benchmarks that were copied over from tests and adapted. I'll use programs/xmalloc.h here then. Siddhesh