Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit a38bda9fb279c6dd01f9b8b7e55f9f60832e9721 1 parent 97b0000
@avz avz authored bnoordhuis committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/platform_freebsd.cc
View
2  src/platform_freebsd.cc
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.