summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-02-23 11:02:33 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-02-23 11:02:33 -0500
commit296a557bfc5769617da53eee5a8670e2428ca458 (patch)
tree4fa2ad2d37b54fd69f64363190cece279d86231b /src/lib
parent21317c92296f0c08176c8788f8f2bcf501e78032 (diff)
downloadtor-296a557bfc5769617da53eee5a8670e2428ca458.tar.gz
tor-296a557bfc5769617da53eee5a8670e2428ca458.zip
Remove mallinfo() from codebase
Now deprecated in libc >= 2.33 Closes #40309 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/meminfo/meminfo.c23
-rw-r--r--src/lib/meminfo/meminfo.h1
2 files changed, 0 insertions, 24 deletions
diff --git a/src/lib/meminfo/meminfo.c b/src/lib/meminfo/meminfo.c
index f4fa45167e..bc3eef8419 100644
--- a/src/lib/meminfo/meminfo.c
+++ b/src/lib/meminfo/meminfo.c
@@ -37,29 +37,6 @@
#include <sys/sysctl.h>
#endif
-DISABLE_GCC_WARNING(aggregate-return)
-/** Call the platform malloc info function, and dump the results to the log at
- * level <b>severity</b>. If no such function exists, do nothing. */
-void
-tor_log_mallinfo(int severity)
-{
-#ifdef HAVE_MALLINFO
- struct mallinfo mi;
- memset(&mi, 0, sizeof(mi));
- mi = mallinfo();
- tor_log(severity, LD_MM,
- "mallinfo() said: arena=%d, ordblks=%d, smblks=%d, hblks=%d, "
- "hblkhd=%d, usmblks=%d, fsmblks=%d, uordblks=%d, fordblks=%d, "
- "keepcost=%d",
- mi.arena, mi.ordblks, mi.smblks, mi.hblks,
- mi.hblkhd, mi.usmblks, mi.fsmblks, mi.uordblks, mi.fordblks,
- mi.keepcost);
-#else /* !(defined(HAVE_MALLINFO)) */
- (void)severity;
-#endif /* defined(HAVE_MALLINFO) */
-}
-ENABLE_GCC_WARNING(aggregate-return)
-
#if defined(HW_PHYSMEM64)
/* OpenBSD and NetBSD define this */
#define INT64_HW_MEM HW_PHYSMEM64
diff --git a/src/lib/meminfo/meminfo.h b/src/lib/meminfo/meminfo.h
index 2d64e1ab06..6f29fe0ea8 100644
--- a/src/lib/meminfo/meminfo.h
+++ b/src/lib/meminfo/meminfo.h
@@ -15,7 +15,6 @@
#include "lib/testsupport/testsupport.h"
#include <stddef.h>
-void tor_log_mallinfo(int severity);
MOCK_DECL(int, get_total_system_memory, (size_t *mem_out));
#endif