Commit 4eda6c3
committed
Fix unaligned load error on 32-bit architectures
On some 32-bit architectures, 64-bit atomic operations panic when the
value is not aligned properly.
In this package, this causes netConn operations to panic when compiling
with GOARCH=386, since netConn does atomic operations with int64 values
in the netConn struct (namely, with readExpired and writeExpired).
This commit fixes this by moving readExpired and writeExpired to the
beginning of the struct, which makes them properly aligned.1 parent 8060f3a commit 4eda6c3
1 file changed
+14
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
0 commit comments