mirror of
https://github.com/golang/go
synced 2024-11-21 20:54:45 -07:00
runtime: check that SysReserve returns aligned memory
R=iant, iant2 CC=golang-dev https://golang.org/cl/4180043
This commit is contained in:
parent
7e77623120
commit
48535ae3f1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user