Bug 1153683 - mozjemalloc: track MADV_FREE'd pages on all BSDs. draft
authorJan Beich <jbeich@FreeBSD.org>
Fri, 12 May 2017 20:12:45 +0000
changeset 577124 9bc7b498eb9b9a056a870abb9af1ffd5c3ca5413
parent 577123 9e248353d69612c6d861b0e87959e87de1154137
child 577125 64aef5a9dc01c8cf479ce08164f48f6ad793771f
push id58619
push userbmo:jbeich@FreeBSD.org
push dateFri, 12 May 2017 21:48:08 +0000
bugs1153683
milestone55.0a1
Bug 1153683 - mozjemalloc: track MADV_FREE'd pages on all BSDs. MozReview-Commit-ID: ALPXVxR8heH
memory/mozjemalloc/jemalloc.c
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -120,17 +120,17 @@
  * We therefore define MALLOC_DOUBLE_PURGE on Mac.  This causes jemalloc to
  * track which pages have been MADV_FREE'd.  You can then call
  * jemalloc_purge_freed_pages(), which will force the OS to release those
  * MADV_FREE'd pages, making the process's RSS reflect its true memory usage.
  *
  * The jemalloc_purge_freed_pages definition in memory/build/mozmemory.h needs
  * to be adjusted if MALLOC_DOUBLE_PURGE is ever enabled on Linux.
  */
-#ifdef MOZ_MEMORY_DARWIN
+#if defined(MOZ_MEMORY_DARWIN) || defined(MOZ_MEMORY_BSD)
 #define MALLOC_DOUBLE_PURGE
 #endif
 
 /*
  * MALLOC_PRODUCTION disables assertions and statistics gathering.  It also
  * defaults the A and J runtime options to off.  These settings are appropriate
  * for production systems.
  */