libstdc++: glibc mallinfo deprecated, use mallinfo2 when version => 2.33     glibc mallinfo is now deprecated resulting in make check-performance     failure. When glibc => 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 >= 2.33. Tested under Linux x86_64. Ok to commit ? François On 07/09/22 19:10, Jonathan Wakely wrote: > On Wed, 7 Sept 2022 at 18:03, François Dumont via Libstdc++ > wrote: >> libstdc++: Use glibc >= 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 >= 2.33 use >> mallinfo2 to >> populate it. >> >> Tested under Linux x86_64, >> >> Ok to commit ? >> >> François