alignWrite aligns the (write) position if necessary and suitable according to the specified alignment mask. It doubles as final payload padding helpmate in order to keep the kernel happy.
(m int)
| 281 | // the specified alignment mask. It doubles as final payload padding helpmate in |
| 282 | // order to keep the kernel happy. |
| 283 | func (a *AlignedBuff) alignWrite(m int) { |
| 284 | pos := (a.pos + m) & ^m |
| 285 | if pos != a.pos { |
| 286 | a.data = append(a.data, padding[:pos-a.pos]...) |
| 287 | a.pos = pos |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | // This is ... ugly. |
| 292 | var uint16AlignMask = int(unsafe.Alignof(uint16(0)) - 1) |
no outgoing calls
no test coverage detected