Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix broken os.totalmem() on FreeBSD amd64 #1233

Closed
wants to merge 1 commit into from

2 participants

@avz

sysctl(CTL_HW, HW_PHYSMEM) always returns unsigned long. Will work fine for 32 and 64 bit systems

@pquerna
Owner

@avz: Can you please submit a node.js CLA in order to merge this patch: http://nodejs.org/cla.html

Thanks!

@avz
avz commented

@pquerna: done

@pquerna pquerna closed this pull request from a commit
@avz avz sysctl(CTL_HW, HW_PHYSMEM) always returns unsigned long. Will work fi…
…ne for 32 and 64 bit systems. Closes #1233.
cc83455
@pquerna pquerna closed this in cc83455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 26, 2011
  1. @avz

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

    avz authored
    …ne for 32 and 64 bit systems
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/platform_freebsd.cc
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) {
Something went wrong with that request. Please try again.