diff --git a/src/runtime/arch_amd64.go b/src/runtime/arch_amd64.go index db784327..9fcb739e 100644 --- a/src/runtime/arch_amd64.go +++ b/src/runtime/arch_amd64.go @@ -5,7 +5,9 @@ const GOARCH = "amd64" // The bitness of the CPU (e.g. 8, 32, 64). const TargetBits = 64 -// Align on word boundary. +// Align a pointer. +// Note that some amd64 instructions (like movaps) expect 16-byte aligned +// memory, thus the result must be 16-byte aligned. func align(ptr uintptr) uintptr { - return (ptr + 7) &^ 7 + return (ptr + 15) &^ 15 }