From 38252e338fc29c2335f960713a8f38767908f1cc Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 15 Dec 2022 18:31:11 +0100 Subject: [PATCH] runtime: arm64 actually has 16-byte alignment like amd64 Proof: https://godbolt.org/z/as4EM3713 Essentially, this means that there are objects on arm64 that have a 16-byte alignment and so we have to respect that when we allocate things on the heap. --- src/runtime/arch_arm64.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/arch_arm64.go b/src/runtime/arch_arm64.go index 373be884..a481fb1a 100644 --- a/src/runtime/arch_arm64.go +++ b/src/runtime/arch_arm64.go @@ -9,7 +9,7 @@ const deferExtraRegs = 0 // Align on word boundary. func align(ptr uintptr) uintptr { - return (ptr + 7) &^ 7 + return (ptr + 15) &^ 15 } func getCurrentStackPointer() uintptr {