Commit e34dce0
authored
Fix alignment in chunkedContentCoder (#147)
An unaligned atomic bug was unfortunately introduced in #119 because the
`bytesWritten` field was placed at the end of the `chunkedContentCoder`
struct.
This places this after the bytes.Buffers and the bool causing it to be
misaligned.
The ideal placement of this variable is not entirely clear but placing
it before the progresiveWrite bool should help.
An alternative would be to just place this atomic field at the top of
the struct then there would be no risk of it becoming misaligned in
future.
I moved a few things around to reduce the size of the struct too but it
could be possible to adjust things a little more to make the struct a
little smaller.
Signed-off-by: Andrew Thornton <[email protected]>1 parent 96a016b commit e34dce0
1 file changed
+10
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | 194 | | |
196 | 195 | | |
197 | 196 | | |
| |||
0 commit comments