Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: nspr/pr/src/misc/prsystem.c

Issue 1019063003: Update to NSPR 4.10.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss.git@master
Patch Set: README bump Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nspr/pr/src/misc/prolock.c ('k') | nspr/pr/src/pthreads/ptthread.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/misc/prsystem.c
diff --git a/nspr/pr/src/misc/prsystem.c b/nspr/pr/src/misc/prsystem.c
index 7a250713a6832327ef55e6019a8d5942f1ce1ba9..eba85fb0b3fa355bac08e3d735990bbc7e814d55 100644
--- a/nspr/pr/src/misc/prsystem.c
+++ b/nspr/pr/src/misc/prsystem.c
@@ -24,7 +24,7 @@
/* BSD-derived systems use sysctl() to get the number of processors */
#if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \
- || defined(OPENBSD) || defined(DARWIN)
+ || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN)
#define _PR_HAVE_SYSCTL
#include <sys/param.h>
#include <sys/sysctl.h>
@@ -275,15 +275,24 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void)
if (pageSize >= 0 && pageCount >= 0)
bytes = (PRUint64) pageSize * pageCount;
-#elif defined(NETBSD) || defined(OPENBSD)
+#elif defined(NETBSD) || defined(OPENBSD) \
+ || defined(FREEBSD) || defined(DRAGONFLY)
int mib[2];
int rc;
+#ifdef HW_PHYSMEM64
uint64_t memSize;
+#else
+ unsigned long memSize;
+#endif
size_t len = sizeof(memSize);
mib[0] = CTL_HW;
+#ifdef HW_PHYSMEM64
mib[1] = HW_PHYSMEM64;
+#else
+ mib[1] = HW_PHYSMEM;
+#endif
rc = sysctl(mib, 2, &memSize, &len, NULL, 0);
if (-1 != rc) {
bytes = memSize;
« no previous file with comments | « nspr/pr/src/misc/prolock.c ('k') | nspr/pr/src/pthreads/ptthread.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698