Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sysctl(CTL_HW, HW_PHYSMEM) always returns unsigned long. Will work fi…

…ne for 32 and 64 bit systems. Closes #1233.
  • Loading branch information...
commit cc834555347c38dd07d798f2f28fda0937142baa 1 parent 3dbb3cd
@avz avz authored pquerna committed
Showing with 6 additions and 6 deletions.
  1. +4 −0 ChangeLog
  2. +2 −6 src/platform_freebsd.cc
View
4 ChangeLog
@@ -1,3 +1,7 @@
+In development, Version 0.5.1 (unstable)
+
+* #1233 Fix os.totalmem on FreeBSD amd64 (Artem Zaytsev)
+
2011.07.05, Version 0.5.0 (unstable)
* New non-default libuv backend to support IOCP on Windows.
View
8 src/platform_freebsd.cc
@@ -181,13 +181,9 @@ double Platform::GetFreeMemory() {
}
double Platform::GetTotalMemory() {
-#if defined(HW_PHYSMEM64)
- uint64_t info;
- static int which[] = {CTL_HW, HW_PHYSMEM64};
-#else
- unsigned int info;
+ unsigned long info;
static int which[] = {CTL_HW, HW_PHYSMEM};
-#endif
+
size_t size = sizeof(info);
if (sysctl(which, 2, &info, &size, NULL, 0) < 0) {

0 comments on commit cc83455

Please sign in to comment.
Something went wrong with that request. Please try again.