From 9ff8bb64aa1d7a20ed8252bb52898ff0d7044ca4 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 11 Feb 2014 10:43:41 +0900 Subject: [PATCH] Bug 969800 - Fix nsMemoryReporterManager::GetVsize for !HAVE_VSIZE_AND_RESIDENT_REPORTERS and add GNU/kFreeBSD support to nsMemoryReporterManager. r=njn --- xpcom/base/nsMemoryReporterManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 0e00254c73d..8cb89b1ddd3 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -120,11 +120,12 @@ public: NS_IMPL_ISUPPORTS1(ResidentUniqueReporter, nsIMemoryReporter) #elif defined(__DragonFly__) || defined(__FreeBSD__) \ - || defined(__NetBSD__) || defined(__OpenBSD__) + || defined(__NetBSD__) || defined(__OpenBSD__) \ + || defined(__FreeBSD_kernel__) #include #include -#if defined(__DragonFly__) || defined(__FreeBSD__) +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #endif @@ -141,7 +142,7 @@ NS_IMPL_ISUPPORTS1(ResidentUniqueReporter, nsIMemoryReporter) #if defined(__DragonFly__) #define KP_SIZE(kp) (kp.kp_vm_map_size) #define KP_RSS(kp) (kp.kp_vm_rssize * getpagesize()) -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define KP_SIZE(kp) (kp.ki_size) #define KP_RSS(kp) (kp.ki_rssize * getpagesize()) #elif defined(__NetBSD__) @@ -1381,7 +1382,7 @@ nsMemoryReporterManager::GetVsize(int64_t* aVsize) #ifdef HAVE_VSIZE_AND_RESIDENT_REPORTERS return VsizeDistinguishedAmount(aVsize); #else - *aResident = 0; + *aVsize = 0; return NS_ERROR_NOT_AVAILABLE; #endif }