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: AS3215 2.6.0.0/16 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 01AE41F8C6 for ; Wed, 28 Jul 2021 08:28:58 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 152693853C26 for ; Wed, 28 Jul 2021 08:28:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 152693853C26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627460937; bh=2hrTT/pjrb7d5M6VSiuUvTjvof77HMdTUE3vkWya024=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=F0ysz5wX8UElzSJRbgdGrqye+rY6bqadnxyckaZoQvDljXvX94mcCpmP1upDKSQvM NOXW8vlry2zHzepF736CqREQDgtkqp6NYngd+Lmct+zQozaH65g+bVGnC+/6L4xCGq vTOesvijVzMnZNO/dMW3DXLIqiMq6hqnBCsugz5E= Received: from black.elm.relay.mailchannels.net (black.elm.relay.mailchannels.net [23.83.212.19]) by sourceware.org (Postfix) with ESMTPS id 64180398B897 for ; Wed, 28 Jul 2021 08:03:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 64180398B897 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 40A94921F8D; Wed, 28 Jul 2021 08:03:08 +0000 (UTC) Received: from pdx1-sub0-mail-a75.g.dreamhost.com (100-96-18-103.trex-nlb.outbound.svc.cluster.local [100.96.18.103]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B00B19215E7; Wed, 28 Jul 2021 08:03:07 +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.18.103 (trex/6.3.3); Wed, 28 Jul 2021 08:03:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Reign-Skirt: 4462a61237241521_1627459387966_2294815461 X-MC-Loop-Signature: 1627459387966:481704417 X-MC-Ingress-Time: 1627459387966 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 64F768C383; Wed, 28 Jul 2021 01:03:07 -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 B13AB8C377; Wed, 28 Jul 2021 01:03:05 -0700 (PDT) Subject: Re: [PATCH v2] tests: use xmalloc to allocate implementation array To: Florian Weimer References: <20210728073530.3917457-1-siddhesh@sourceware.org> <875ywuamzd.fsf@oldenburg.str.redhat.com> X-DH-BACKEND: pdx1-sub0-mail-a75 Message-ID: Date: Wed, 28 Jul 2021 13:33:00 +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: <875ywuamzd.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 Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 7/28/21 1:28 PM, Florian Weimer wrote: > * Siddhesh Poyarekar: > >> The benchmark and tests must fail in case of allocation failure in the >> implementation array. Also annotate the x* allocators in support.h so >> that the compiler has more information about them. >> --- >> benchtests/bench-string.h | 5 +++-- >> string/test-string.h | 5 +++-- >> support/support.h | 24 +++++++++++++++++------- >> 3 files changed, 23 insertions(+), 11 deletions(-) >> >> diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h >> index fd25264417..12f27473ff 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; \ > > Okay if it actually links. > It does because it uses the xmalloc in libsupport. I'll wean the benchmarks away from libsupport in 2.35. Siddhesh