On Wed, 7 Sept 2022 at 18:03, François Dumont via Libstdc++
<libstd...@gcc.gnu.org> 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

Reply via email to