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 C776D385841A for ; Wed, 7 Sep 2022 17:10:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C776D385841A 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=1662570647; 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=Cj2nt401wTJ1eFIoSXHfyHh63ur18dfVxXSYKT6vtVEVNUNV6+T4nPfTApncgXs9Knyn2N i4fFGOlbdXrBrBeU+rvE5at9oFelEOCTK7No/cmzlj4Tkzf9BTH3jilrGZkQ8Fs+FWcpzA hkQJgkVpaCfOSbLUr5wSlDcvVhM6ijU= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-330-_LYg_wV4NQufGrSp3LHzaw-1; Wed, 07 Sep 2022 13:10:38 -0400 X-MC-Unique: _LYg_wV4NQufGrSp3LHzaw-1 Received: by mail-qt1-f197.google.com with SMTP id ew6-20020a05622a514600b0035990b1ae0bso1663031qtb.8 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=TLANaWcIEd0eqtEb7gYnYQKsKpAY4BANIrc96y5vJsxGwSYEwPWCSJaj9Z5crAXWrw yzda6a7RQIvdcwQi4Arxbm1DR9AOeKM42k31+xWhS3xjhm2kEQo0tgVNntykP2DHk6hW X8fNSHadRQjiTb6vDnTMTes48fcMhld8C0qArs/m3S0nGeqGjR0UqFi4K1JXjoCjVGbE qz4O7aFIA8T/E1VRMsFcmjKw0kUV/eB/IPgclWji5l/a9/OIfGg9zo78gUgSDDe2UNma sLZolJ/z/fSuzb+YRSvUFir7BPdaeAVPH/tF8UY8S1XKJ0ueqDhBHJqg2LgUdSHwAa1P Kspw== X-Gm-Message-State: ACgBeo2qApSsyWVFKIB2eiFw3XnaE2aoaaqPZWaybvt1Bprk/LV43fqi m7Mn9IQ3gQ1/v5X93+1U7UhArWc5doc3/IJKySyEiGoJkzNC//SvCT+F15BfvGgRFqhzYBPcDuB Zzoc0G46TJbVr3rqgV2fgewFCb3qURfo= X-Received: by 2002:a05:622a:1003:b0:344:b4cc:b5f with SMTP id d3-20020a05622a100300b00344b4cc0b5fmr4269421qte.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=unavailable 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