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.129.124]) by sourceware.org (Postfix) with ESMTPS id C43EE3858D39 for ; Thu, 8 Sep 2022 08:48:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C43EE3858D39 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=1662626901; 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=IjufbYvZW+t/jodqB1d/8dbng9ww/57wK4N2zZKcAA4=; b=M9vbYfkEpQrXMBb+OnWcnvHjGQPYEzyNI4XkNHjgLuqBOjLWIVKvgmRdOf6RmetQlVLvt8 6lKSyDYCYZ/ERImUyoNW5uHU5E0D4eSHi6ePfELv8VuUBCoY+eR8aqvIqB4ODJ1UXfDUyI X0fmTIWihMZDLhUF/ZaKA1mn++eWYPg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-551-XWg7TTDtMiSX_tHlDFUS3g-1; Thu, 08 Sep 2022 04:48:20 -0400 X-MC-Unique: XWg7TTDtMiSX_tHlDFUS3g-1 Received: by mail-qk1-f199.google.com with SMTP id bi16-20020a05620a319000b006bc2334be53so14133404qkb.14 for ; Thu, 08 Sep 2022 01:48:20 -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=IjufbYvZW+t/jodqB1d/8dbng9ww/57wK4N2zZKcAA4=; b=sxrnPxAJxkmfz9BzDaEAeUOkd3GGgm9TEh4s9QY2MxrPrJTMcnJoH/jrHuACurN9bP tZQIP5XsPTueqipW1s1/XAZevAGa6UcE/VjxbzfGiVpvg1Rk0GFCAZOpKMNcU4RjAgDd GHUySSWv8etcQsNfZMG8M0ZnQPxKYify4bmLdONHn0lA5B9nlfM6cO2iiFpL6ndV/KJQ 0XkfvUM2IVql7FPlrbZavMMzvWSyiXzFLPZT73OMrbh3ebALl5n52cPSvzITsbA3UEvw OyZs972oJEHY59oe5IOUBqCpDbO9YG3VQb/o+zhSMjGHsZ53xdALu5NqnmFv/iwkuexT KfMA== X-Gm-Message-State: ACgBeo2/86v/dzrgHS5FLdUBXkm5C2gPyIN7oXJpCz1E49WIr3CeutcU /bK9T56I/WEfWSUzqMYi/3AoinSamOz/F8oKBRfjZq5K6G68BqOvZKuuGuAQ4WCcQ8oswWVD18g jy/k7Ct6yVERu4+sY76YPV9sLm9xYdBw= X-Received: by 2002:a05:620a:2728:b0:6ba:e857:9375 with SMTP id b40-20020a05620a272800b006bae8579375mr5577069qkp.728.1662626899849; Thu, 08 Sep 2022 01:48:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR7wzze+pD84T7/gjjSCflPwLb7YsVTpVqyLE0bmpwCiWfaKnuZ0tfIGO7mBgZM67M9kbj8toUjHwzo2L6fA9+s= X-Received: by 2002:a05:620a:2728:b0:6ba:e857:9375 with SMTP id b40-20020a05620a272800b006bae8579375mr5577067qkp.728.1662626899641; Thu, 08 Sep 2022 01:48:19 -0700 (PDT) MIME-Version: 1.0 References: <5d4e8613-c9f9-f63d-c739-fdd126f9e83a@gmail.com> In-Reply-To: <5d4e8613-c9f9-f63d-c739-fdd126f9e83a@gmail.com> From: Jonathan Wakely Date: Thu, 8 Sep 2022 09:48:08 +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.8 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 Thu, 8 Sept 2022 at 06:03, Fran=C3=A7ois Dumont w= rote: > > libstdc++: glibc mallinfo deprecated, use mallinfo2 when version =3D= > > 2.33 > > glibc mallinfo is now deprecated resulting in make check-performance > failure. When glibc =3D> 2.33 prefer mallinfo2. > > libstdcxx-v3/ChangeLog: > > * testsuite/util/testsuite_performance.h > (__gnu_test::MallocInfo): New. > (__gnu_test::malloc_info): New, replace mallinfo on current > platform > supporting it and use mallinfo2 when glibc >=3D 2.33. > > Tested under Linux x86_64. > > Ok to commit ? Yes, looks good, thanks! > > Fran=C3=A7ois > > On 07/09/22 19:10, Jonathan Wakely wrote: > > 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 us= e > >> mallinfo2 to > >> populate it. > >> > >> Tested under Linux x86_64, > >> > >> Ok to commit ? > >> > >> Fran=C3=A7ois >