Commit 97e51dd0 authored by David Goulet's avatar David Goulet 🐼
Browse files

Merge branch 'tor-gitlab/mr/326' into maint-0.4.5

parents bc21ed32 ad4f87ed
Loading
Loading
Loading
Loading

changes/ticket40309

0 → 100644
+3 −0
Original line number Diff line number Diff line
  o New system requirements (mallinfo() deprecated):
    - Remove mallinfo() usage entirely. Libc 2.33+ now deprecates it. Closes
      ticket 40309.
+0 −1
Original line number Diff line number Diff line
@@ -2143,7 +2143,6 @@ AS_CASE([$malloc],

  [system], [
     # handle this later, including the jemalloc fallback
    AC_CHECK_FUNCS(mallinfo)
  ],

  [AC_MSG_ERROR([--with-malloc=`$with_malloc' not supported, see --help])
+0 −1
Original line number Diff line number Diff line
@@ -323,7 +323,6 @@ dumpmemusage(int severity)
  dump_routerlist_mem_usage(severity);
  dump_cell_pool_usage(severity);
  dump_dns_mem_usage(severity);
  tor_log_mallinfo(severity);
}

/** Write all statistics to the log, with log level <b>severity</b>. Called
+0 −23
Original line number Diff line number Diff line
@@ -37,29 +37,6 @@
#include <sys/sysctl.h>
#endif

DISABLE_GCC_WARNING("-Waggregate-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("-Waggregate-return")

#if defined(HW_PHYSMEM64)
/* OpenBSD and NetBSD define this */
#define INT64_HW_MEM HW_PHYSMEM64
+0 −1
Original line number Diff line number Diff line
@@ -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 /* !defined(TOR_MEMINFO_H) */
Loading