|
|
|
@ -55,22 +55,8 @@ func init() {
|
|
|
|
|
// Reset resets m so that it's ready to be used again. Afterward, the contents
|
|
|
|
|
// are solely a zeroed fusekernel.OutHeader struct.
|
|
|
|
|
func (m *OutMessage) Reset() {
|
|
|
|
|
// Ideally we'd like to write:
|
|
|
|
|
//
|
|
|
|
|
// m.payloadOffset = 0
|
|
|
|
|
// m.header = fusekernel.OutHeader{}
|
|
|
|
|
//
|
|
|
|
|
// But Go 1.8 beta 2 generates bad code for this
|
|
|
|
|
// (https://golang.org/issue/18370). Encourage it to generate the same code
|
|
|
|
|
// as Go 1.7.4 did.
|
|
|
|
|
if unsafe.Offsetof(m.payload) != 24 {
|
|
|
|
|
panic("unexpected OutMessage layout")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a := (*[3]uint64)(unsafe.Pointer(m))
|
|
|
|
|
a[0] = 0
|
|
|
|
|
a[1] = 0
|
|
|
|
|
a[2] = 0
|
|
|
|
|
m.payloadOffset = 0
|
|
|
|
|
m.header = fusekernel.OutHeader{}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// OutHeader returns a pointer to the header at the start of the message.
|
|
|
|
|