Shuffle struct for alignment

This commit is contained in:
Neil Alexander 2022-02-01 10:12:52 +00:00
parent 7242029e43
commit 57b0f19166
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -272,10 +272,12 @@ func (intf *link) name() string {
} }
type linkConn struct { 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 rx uint64
tx uint64 tx uint64
up time.Time up time.Time
net.Conn
} }
func (c *linkConn) Read(p []byte) (n int, err error) { func (c *linkConn) Read(p []byte) (n int, err error) {