dtagnames: Stop using the deprecated mallinfo() function

Bulding on fedora rawhide gets us:

  /home/acme/git/pahole/dtagnames.c:17:16: error: ‘mallinfo’ is deprecated [-Werror=deprecated-declarations]
     17 |         struct mallinfo m = mallinfo();
        |                ^~~~~~~~
  In file included from /home/acme/git/pahole/dtagnames.c:10:
  /usr/include/malloc.h:118:24: note: declared here
    118 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
        |                        ^~~~~~~~
  cc1: all warnings being treated as errors

glibc-2.32.9000-26.fc34.x86_64

So stop using it, was just for debugging/assessing memory usage.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-02-02 09:38:46 -03:00
parent 1279e439b6
commit 66d12e4790
1 changed files with 0 additions and 9 deletions

View File

@ -7,18 +7,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include "dwarves.h"
#include "dutil.h"
static void print_malloc_stats(void)
{
struct mallinfo m = mallinfo();
fprintf(stderr, "size: %u\n", m.uordblks);
}
static int class__tag_name(struct tag *tag, struct cu *cu __unused,
void *cookie __unused)
{
@ -54,7 +46,6 @@ int main(int argc __unused, char *argv[])
}
cus__dump_class_tag_names(cus);
print_malloc_stats();
rc = EXIT_SUCCESS;
out:
cus__delete(cus);