mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user