Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
sysctl(CTL_HW, HW_PHYSMEM) always returns unsigned long. Will work fi…
Browse files Browse the repository at this point in the history
…ne for 32 and 64 bit systems. Closes #1233.
  • Loading branch information
avz authored and pquerna committed Jul 7, 2011
1 parent 3dbb3cd commit cc83455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 2 additions & 6 deletions src/platform_freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cc83455

Please sign in to comment.