]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix chan alignment on 32 bits
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 25 Aug 2014 13:19:56 +0000 (17:19 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 25 Aug 2014 13:19:56 +0000 (17:19 +0400)
LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews, khr, rsc
https://golang.org/cl/128700043

src/pkg/runtime/chan.h

index 52eb20099dcb69b86c06a77dba94a4ab4a8a3b6f..30825eafad681e5c183549a3e9eb41fa5c42c82c 100644 (file)
@@ -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