diff options
author | Florian Smeets <flo@FreeBSD.org> | 2013-10-30 20:37:55 +0000 |
---|---|---|
committer | Florian Smeets <flo@FreeBSD.org> | 2013-10-30 20:37:55 +0000 |
commit | 2cd503bcdb5f9bb9fadb663412a68fb84e801524 (patch) | |
tree | a87ddf1d023ec31d88d818886f89a42f8183ebd2 /www/firefox-esr/files/patch-bug791366 | |
parent | 8603282df1f4ec28fd2ffa11843c31f4a4dcea3a (diff) | |
download | ports-2cd503bcdb5f9bb9fadb663412a68fb84e801524.tar.gz ports-2cd503bcdb5f9bb9fadb663412a68fb84e801524.zip |
Notes
Diffstat (limited to 'www/firefox-esr/files/patch-bug791366')
-rw-r--r-- | www/firefox-esr/files/patch-bug791366 | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/www/firefox-esr/files/patch-bug791366 b/www/firefox-esr/files/patch-bug791366 deleted file mode 100644 index 2be866d928cd..000000000000 --- a/www/firefox-esr/files/patch-bug791366 +++ /dev/null @@ -1,95 +0,0 @@ -diff --git xpcom/base/nsMemoryReporterManager.cpp xpcom/base/nsMemoryReporterManager.cpp -index a9aff58..674e757 100644 ---- xpcom/base/nsMemoryReporterManager.cpp -+++ xpcom/base/nsMemoryReporterManager.cpp -@@ -32,7 +32,7 @@ using namespace mozilla; - # include "jemalloc.h" - #endif // MOZ_MEMORY - --#if defined(XP_LINUX) || defined(XP_MACOSX) || defined(SOLARIS) -+#ifdef XP_UNIX - - #include <sys/time.h> - #include <sys/resource.h> -@@ -95,6 +95,81 @@ static nsresult GetResident(PRInt64 *n) - return GetProcSelfStatmField(1, n); - } - -+#elif defined(__DragonFly__) || defined(__FreeBSD__) \ -+ || defined(__NetBSD__) || defined(__OpenBSD__) -+ -+#include <sys/param.h> -+#include <sys/sysctl.h> -+#if defined(__DragonFly__) || defined(__FreeBSD__) -+#include <sys/user.h> -+#endif -+ -+#include <unistd.h> -+ -+#if defined(__NetBSD__) -+#undef KERN_PROC -+#define KERN_PROC KERN_PROC2 -+#define KINFO_PROC struct kinfo_proc2 -+#else -+#define KINFO_PROC struct kinfo_proc -+#endif -+ -+#if defined(__DragonFly__) -+#define KP_SIZE(kp) (kp.kp_vm_map_size) -+#define KP_RSS(kp) (kp.kp_vm_rssize * getpagesize()) -+#elif defined(__FreeBSD__) -+#define KP_SIZE(kp) (kp.ki_size) -+#define KP_RSS(kp) (kp.ki_rssize * getpagesize()) -+#elif defined(__NetBSD__) -+#define KP_SIZE(kp) (kp.p_vm_msize * getpagesize()) -+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize()) -+#elif defined(__OpenBSD__) -+#define KP_SIZE(kp) ((kp.p_vm_dsize + kp.p_vm_ssize \ -+ + kp.p_vm_tsize) * getpagesize()) -+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize()) -+#endif -+ -+static nsresult GetKinfoProcSelf(KINFO_PROC *proc) -+{ -+ int mib[] = { -+ CTL_KERN, -+ KERN_PROC, -+ KERN_PROC_PID, -+ getpid(), -+#if defined(__NetBSD__) || defined(__OpenBSD__) -+ sizeof(KINFO_PROC), -+ 1, -+#endif -+ }; -+ u_int miblen = sizeof(mib) / sizeof(mib[0]); -+ size_t size = sizeof(KINFO_PROC); -+ if (sysctl(mib, miblen, proc, &size, NULL, 0)) -+ return NS_ERROR_FAILURE; -+ -+ return NS_OK; -+} -+ -+#define HAVE_VSIZE_AND_RESIDENT_REPORTERS 1 -+static nsresult GetVsize(PRInt64 *n) -+{ -+ KINFO_PROC proc; -+ nsresult rv = GetKinfoProcSelf(&proc); -+ if (NS_SUCCEEDED(rv)) -+ *n = KP_SIZE(proc); -+ -+ return rv; -+} -+ -+static nsresult GetResident(PRInt64 *n) -+{ -+ KINFO_PROC proc; -+ nsresult rv = GetKinfoProcSelf(&proc); -+ if (NS_SUCCEEDED(rv)) -+ *n = KP_RSS(proc); -+ -+ return rv; -+} -+ - #elif defined(SOLARIS) - - #include <procfs.h> |