From 48535ae3f10e685f2385b67dbcc3037e8c297b5f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 11 Feb 2011 14:32:34 -0500 Subject: [PATCH] runtime: check that SysReserve returns aligned memory R=iant, iant2 CC=golang-dev https://golang.org/cl/4180043 --- src/pkg/runtime/malloc.goc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc index 18652d71a6..70b85d68d7 100644 --- a/src/pkg/runtime/malloc.goc +++ b/src/pkg/runtime/malloc.goc @@ -297,6 +297,9 @@ runtime·mallocinit(void) if(p == nil) runtime·throw("runtime: cannot reserve arena virtual address space"); } + if((uintptr)p & (((uintptr)1<