From 57b0f1916628acd14e63f8321ed9c8b5fd60c2fc Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 1 Feb 2022 10:12:52 +0000 Subject: [PATCH] Shuffle struct for alignment --- src/core/link.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/link.go b/src/core/link.go index 14a32cb3..bec43a2a 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -272,10 +272,12 @@ func (intf *link) name() string { } type linkConn struct { - net.Conn + // tx and rx are at the beginning of the struct to ensure 64-bit alignment + // on 32-bit platforms, see https://pkg.go.dev/sync/atomic#pkg-note-BUG rx uint64 tx uint64 up time.Time + net.Conn } func (c *linkConn) Read(p []byte) (n int, err error) {