mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 14:45:07 +03:00
Shuffle struct for alignment
This commit is contained in:
parent
7242029e43
commit
57b0f19166
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue