Commit 48535ae3 authored by Russ Cox's avatar Russ Cox

runtime: check that SysReserve returns aligned memory

R=iant, iant2
CC=golang-dev
https://golang.org/cl/4180043
parent 7e776231
......@@ -297,6 +297,9 @@ runtime·mallocinit(void)
if(p == nil)
runtime·throw("runtime: cannot reserve arena virtual address space");
}
if((uintptr)p & (((uintptr)1<<PageShift)-1))
runtime·throw("runtime: SysReserve returned unaligned address");
runtime·mheap.bitmap = p;
runtime·mheap.arena_start = p + bitmap_size;
runtime·mheap.arena_used = runtime·mheap.arena_start;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment