aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2019-03-29 20:03:29 +0000
committerMichael Knyszek <mknyszek@google.com>2019-05-03 18:41:45 +0000
commit1033065ee381da075e458de0420d0a5838e910cb (patch)
tree67d8c179614cd267be7ec060101e1a138faefe8e /src/runtime/malloc.go
parent8b2bd6f5ff3edf24b39294c7d1a86afbd1cfc4f1 (diff)
downloadgo-1033065ee381da075e458de0420d0a5838e910cb.tar.xz
runtime: add physHugePageSize
This change adds the global physHugePageSize which is initialized in osinit(). physHugePageSize contains the system's transparent huge page (or superpage) size in bytes. For #30333. Change-Id: I2f0198c40729dbbe6e6f2676cef1d57dd107562c Reviewed-on: https://go-review.googlesource.com/c/go/+/170858 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index c22c7aa7dc..f2cb6085bc 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -324,6 +324,14 @@ const (
// mallocinit.
var physPageSize uintptr
+// physHugePageSize is the size in bytes of the OS's default physical huge
+// page size whose allocation is opaque to the application.
+//
+// If set, this must be set by the OS init code (typically in osinit) before
+// mallocinit. However, setting it at all is optional, and leaving the default
+// value is always safe (though potentially less efficient).
+var physHugePageSize uintptr
+
// OS-defined helpers:
//
// sysAlloc obtains a large chunk of zeroed memory from the