main: Use mallinfo2 when available at build time

`mallinfo` has been deprecated in favor of `mallinfo2`:
```
The fields of the mallinfo structure that is returned by the
older mallinfo() function are typed as int.  However, because
some internal bookkeeping values may be of type long, the
reported values may wrap around zero and thus be inaccurate.
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1786>
This commit is contained in:
Robert Mader
2021-04-01 01:08:12 +02:00
committed by Marge Bot
parent 757501b33a
commit 3cfbb48f46
4 changed files with 11 additions and 8 deletions

View File

@ -31,11 +31,6 @@
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-systemd.h>
/* Memory report bits */
#ifdef HAVE_MALLINFO
#include <malloc.h>
#endif
#if defined __OpenBSD__ || defined __FreeBSD__
#include <sys/sysctl.h>
#endif