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

This commit is contained in:
avz
2011-06-26 00:30:23 -07:00
committed by Paul Querna
parent 3dbb3cdb6a
commit cc83455534
2 changed files with 6 additions and 6 deletions

View File

@@ -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 File

@@ -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) {