Skip to content

Commit fc4f975

Browse files
committed
device: align 64-bit atomic member in Device
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 9d699ba commit fc4f975

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

device/device.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,17 @@ type Device struct {
5353
publicKey NoisePublicKey
5454
}
5555

56-
rate struct {
57-
underLoadUntil int64
58-
limiter ratelimiter.Ratelimiter
59-
}
60-
6156
peers struct {
6257
sync.RWMutex // protects keyMap
6358
keyMap map[NoisePublicKey]*Peer
6459
}
6560

61+
// Keep this 8-byte aligned
62+
rate struct {
63+
underLoadUntil int64
64+
limiter ratelimiter.Ratelimiter
65+
}
66+
6667
allowedips AllowedIPs
6768
indexTable IndexTable
6869
cookieChecker CookieChecker

0 commit comments

Comments
 (0)