mirror of https://github.com/nodejs/node.git
platform: fix GetFreeMemory() on 64 bits freebsd
v_free_count is defined as u_int v_free_count (struct vmmeter sys/vmmeter.h:87) but variable info defined as unsigned long, this cause error on 64-bits systems because higher 32 bits remain uninitializedpull/22966/head
parent
97b0000c53
commit
a38bda9fb2
|
@ -156,7 +156,7 @@ int Platform::GetCPUInfo(Local<Array> *cpus) {
|
|||
|
||||
double Platform::GetFreeMemory() {
|
||||
double pagesize = static_cast<double>(sysconf(_SC_PAGESIZE));
|
||||
unsigned long info;
|
||||
unsigned int info = 0;
|
||||
size_t size = sizeof(info);
|
||||
|
||||
if (sysctlbyname("vm.stats.vm.v_free_count", &info, &size, NULL, 0) < 0) {
|
||||
|
|
Loading…
Reference in New Issue