aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2020-11-16 22:03:17 +0000
committerMichael Knyszek <mknyszek@google.com>2021-04-29 17:08:05 +0000
commite03cca64073bd1b4704482c81061d19ab019b5cc (patch)
treec94d00e50d48809aae13259777f5c77798b12103 /src/runtime
parent5a8435d701c1c8c39f403942d4f6a0ac065635db (diff)
downloadgo-e03cca64073bd1b4704482c81061d19ab019b5cc.tar.gz
go-e03cca64073bd1b4704482c81061d19ab019b5cc.zip
runtime: use 4 MiB heap arenas on iOS
iOS arm64 is a 64-bit platform but with a strictly 32-bit address space (technically 33 bits, but the bottom half is unavailable to the application). Since address space is limited, use 4 MiB arenas instead of 64 MiB arenas. No changes are needed to the arena index because it's still relatively small; this change just brings iOS more in line with 32-bit platforms. Change-Id: I484e2d273d896fd0a57cd5c25012df0aef160290 Reviewed-on: https://go-review.googlesource.com/c/go/+/270538 Trust: Michael Knyszek <mknyszek@google.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/malloc.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 5e4974d40e..f2d2425f53 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -227,6 +227,7 @@ const (
// -------------- --------- ---------- ---------- -----------
// */64-bit 48 64MB 1 4M (32MB)
// windows/64-bit 48 4MB 64 1M (8MB)
+ // ios/arm64 33 4MB 1 2048 (8KB)
// */32-bit 32 4MB 1 1024 (4KB)
// */mips(le) 31 4MB 1 512 (2KB)
@@ -247,7 +248,7 @@ const (
// logHeapArenaBytes is log_2 of heapArenaBytes. For clarity,
// prefer using heapArenaBytes where possible (we need the
// constant to compute some other constants).
- logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)*(1-sys.GoarchWasm)) + (2+20)*(_64bit*sys.GoosWindows) + (2+20)*(1-_64bit) + (2+20)*sys.GoarchWasm
+ logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)*(1-sys.GoarchWasm)*(1-sys.GoosIos*sys.GoarchArm64)) + (2+20)*(_64bit*sys.GoosWindows) + (2+20)*(1-_64bit) + (2+20)*sys.GoarchWasm + (2+20)*sys.GoosIos*sys.GoarchArm64
// heapArenaBitmapBytes is the size of each heap arena's bitmap.
heapArenaBitmapBytes = heapArenaBytes / (sys.PtrSize * 8 / 2)