From 596bc2a522c307b7c59e2648a50cb015818d67e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kay=20R=C3=B6pke?= Date: Sun, 31 May 2009 14:10:58 +0200 Subject: [PATCH 1/3] fix Darwin side of SIGAR-47: integer multlipcation overflow on 32bit builds with more than 4GB available memory --- src/os/darwin/darwin_sigar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index b32e726b..dce7ba6d 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -460,7 +460,8 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) return status; } - mem->free = vmstat.free_count * sigar->pagesize; + mem->free = vmstat.free_count; + mem->free =* sigar->pagesize; #elif defined(__FreeBSD__) if ((status = sigar_vmstat(sigar, &vmstat)) == SIGAR_OK) { mem->free = vmstat.v_free_count; From 91ba1a2c3ddfee812af81acdc6f5381a2ba9dedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kay=20R=C3=B6pke?= Date: Sun, 31 May 2009 14:32:12 +0200 Subject: [PATCH 2/3] i'm stupid, =* is not going to compile at all. --- src/os/darwin/darwin_sigar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index dce7ba6d..9d71c5ae 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -461,7 +461,7 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) } mem->free = vmstat.free_count; - mem->free =* sigar->pagesize; + mem->free *= sigar->pagesize; #elif defined(__FreeBSD__) if ((status = sigar_vmstat(sigar, &vmstat)) == SIGAR_OK) { mem->free = vmstat.v_free_count; From bace63f7101e064c9ee31095a64bd1340b004df7 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 1 Jun 2009 13:06:41 -0700 Subject: [PATCH 3/3] untabify --- src/os/darwin/darwin_sigar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 9d71c5ae..1007ffb2 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -460,8 +460,8 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) return status; } - mem->free = vmstat.free_count; - mem->free *= sigar->pagesize; + mem->free = vmstat.free_count; + mem->free *= sigar->pagesize; #elif defined(__FreeBSD__) if ((status = sigar_vmstat(sigar, &vmstat)) == SIGAR_OK) { mem->free = vmstat.v_free_count;