]> Cypherpunks repositories - gostls13.git/commit
runtime: fetch physical page size from the OS
authorAustin Clements <austin@google.com>
Tue, 19 Jul 2016 01:40:02 +0000 (21:40 -0400)
committerAustin Clements <austin@google.com>
Tue, 6 Sep 2016 21:05:50 +0000 (21:05 +0000)
commit276a52de55fb48c4e56a778f1f7cac9292d8fad7
tree7ead3e72e915bad7bcead853af4ba10b237188fe
parentd7de8b6d231289b7a6b205508c6f02a5a475cc84
runtime: fetch physical page size from the OS

Currently the physical page size assumed by the runtime is hard-coded.
On Linux the runtime at least fetches the OS page size during init and
sanity checks against the hard-coded value, but they may still differ.
On other OSes we wouldn't even notice.

Add support on all OSes to fetch the actual OS physical page size
during runtime init and lift the sanity check of PhysPageSize from the
Linux init code to general malloc init. Currently this is the only use
of the retrieved page size, but we'll add more shortly.

Updates #12480 and #10180.

Change-Id: I065f2834bc97c71d3208edc17fd990ec9058b6da
Reviewed-on: https://go-review.googlesource.com/25050
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
14 files changed:
src/runtime/defs1_solaris_amd64.go
src/runtime/export_mmap_test.go
src/runtime/malloc.go
src/runtime/os3_solaris.go
src/runtime/os_darwin.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/os_nacl.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd.go
src/runtime/os_plan9.go
src/runtime/os_windows.go
src/runtime/runtime_mmap_test.go