From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6D899385840A for ; Wed, 7 Sep 2022 17:10:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D899385840A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662570641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CxytLNvhYrB39gVF3qH0YxEViOYbPFssy7ZadJsyY8g=; b=UEQCUIQqKyEIBGXElPg+iDQKkz64BEFtqgg/325LoDvb6LoRh4dvlEygM94KJOxAG35zwT KlB53i8z3S+ytLTwyvWzbsu5zufwUBgPMoVaDJXWsP3Q5M/AGuEHf+vH/JwRf28VJ7KlMb ftsBRfSAXkOri5UqKaDP1hjWx84mL2U= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-294-A7X2oLw5MC2yOvDxj9e_Kw-1; Wed, 07 Sep 2022 13:10:38 -0400 X-MC-Unique: A7X2oLw5MC2yOvDxj9e_Kw-1 Received: by mail-qk1-f198.google.com with SMTP id br15-20020a05620a460f00b006bc58c26501so12356563qkb.0 for ; Wed, 07 Sep 2022 10:10:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=CxytLNvhYrB39gVF3qH0YxEViOYbPFssy7ZadJsyY8g=; b=Dypq6lhMvqhxmYLa0B9PL4vjOUvY2MpZfX3E29E0so/2o33JhJJpJgCtr90Xofb4SV C83re/8VktFOK5RrvochrWBH18Tu3br7Unac7BnlhHYYYFBVRQjiaWcPUQH/lf9XgW2v ok/wkLWOM8CFlRxRjnVlwpbYV15IwxJXM35au47z+s67iB6WN+fj0dFST8A5askSZj/F ntNgk0Vk5taaGm22OpeX0syM69ki5vpZVIDnIw0zsAAs70K9A3cG7vjOJ2/ZUOk4yKX9 aoG0f2x3ATPTrHvrECtG7nMLU82H94cXps9FyY1V2FKJkRn9fMIdgsgvZ2KQBSjbo3KT a7IA== X-Gm-Message-State: ACgBeo22G79VvTbaH1lMX1IRgoK2ASVwiM3Fkck1vmDUoHz1PZRcaNRh eTMP3iMI/+AvuVy4RETK/+emOXJ4ITRSQy4G/HQWCSco4gcFxu3lJVu0I6IHoBflbOUyde1weOT J/rhl1RaNGn9TXo6UwPvWoh+135yRfHOhVg== X-Received: by 2002:a05:622a:1003:b0:344:b4cc:b5f with SMTP id d3-20020a05622a100300b00344b4cc0b5fmr4269420qte.301.1662570638482; Wed, 07 Sep 2022 10:10:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6glmfF2PHWJt3q60O0J01P9HWPbQHKuFnrIAnkgX0Ippf18BbPx0iMZteML/oLyow4IyK2SCjp55HJBFh4upM= X-Received: by 2002:a05:622a:1003:b0:344:b4cc:b5f with SMTP id d3-20020a05622a100300b00344b4cc0b5fmr4269402qte.301.1662570638306; Wed, 07 Sep 2022 10:10:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 7 Sep 2022 18:10:27 +0100 Message-ID: Subject: Re: [PATCH] Use mallinfo2 with glibc >= 2.33 To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++@gcc.gnu.org" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 7 Sept 2022 at 18:03, Fran=C3=A7ois Dumont via Libstdc++ wrote: > > libstdc++: Use glibc >=3D 2.33 mallinfo2 function > > mallinfo started to be deprecated which makes performance tests failed > to build, just > adopt mallinfo2. > > libstdcxx-v3/ChangeLog: > > * testsuite/util/testsuite_performance.h (__mallinfo): New, our > own mallinfo There's no reason to use a reserved name here, this isn't a header that users include. I would call the struct MallocInfo and the function malloc_info(). Even better, put them both in namespace __gnu_test, as __gnu_test::MallocInfo and __gnu_test::malloc_info (without the extern "C" language linkage). If we're not calling the glibc function directly, but via our own wrapper, then there's no reason it has to use the name "mallinfo", no reason it has to be in the global namespace, and no reason it has to be extern "C" (in fact, I don't think there was ever a reason for it to be extern "C"). > struct with just what we need. When using glibc >=3D 2.33 use > mallinfo2 to > populate it. > > Tested under Linux x86_64, > > Ok to commit ? > > Fran=C3=A7ois