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 uninitialized
pull/22966/head
Artem Zaytsev 2011-07-30 22:06:46 +04:00 committed by Ben Noordhuis
parent 97b0000c53
commit a38bda9fb2
1 changed files with 1 additions and 1 deletions

View File

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