This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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
  • Loading branch information...
avz authored and bnoordhuis committed Jul 30, 2011
1 parent 97b0000 commit a38bda9fb279c6dd01f9b8b7e55f9f60832e9721
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/platform_freebsd.cc
View
@@ -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) {

0 comments on commit a38bda9

Please sign in to comment.