]> Cypherpunks repositories - gostls13.git/commit
runtime: fix malloc page alignment + efence
authorRuss Cox <rsc@golang.org>
Thu, 6 Mar 2014 23:34:29 +0000 (18:34 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 6 Mar 2014 23:34:29 +0000 (18:34 -0500)
commitda1bea0ef0355482e78b8dc0f3cf2f992a8464d7
tree58b71ad767a3bc2cbee8229d0d88f28f097de47a
parent1d2b7171d500bbd549d6915b3d65340c117807fc
runtime: fix malloc page alignment + efence

Two memory allocator bug fixes.

- efence is not maintaining the proper heap metadata
  to make eventual memory reuse safe, so use SysFault.

- now that our heap PageSize is 8k but most hardware
  uses 4k pages, SysAlloc and SysReserve results must be
  explicitly aligned. Do that in a few more call sites and
  document this fact in malloc.h.

Fixes #7448.

LGTM=iant
R=golang-codereviews, josharian, iant
CC=dvyukov, golang-codereviews
https://golang.org/cl/71750048
src/pkg/runtime/malloc.goc
src/pkg/runtime/malloc.h
src/pkg/runtime/mgc0.c