From 99080c4b6f29aa6ea988747c43475469e761c8a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 25 Aug 2014 17:19:56 +0400 Subject: [PATCH] runtime: fix chan alignment on 32 bits LGTM=dave R=golang-codereviews, dave CC=golang-codereviews, khr, rsc https://golang.org/cl/128700043 --- src/pkg/runtime/chan.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/runtime/chan.h b/src/pkg/runtime/chan.h index 52eb20099d..30825eafad 100644 --- a/src/pkg/runtime/chan.h +++ b/src/pkg/runtime/chan.h @@ -21,6 +21,9 @@ struct Hchan byte* buf; uint16 elemsize; uint32 closed; +#ifndef GOARCH_amd64 + uint32 pad; // ensures proper alignment of the buffer that follows Hchan in memory +#endif Type* elemtype; // element type uintgo sendx; // send index uintgo recvx; // receive index -- 2.48.1