OutMessage.Reset
parent
8b845a25ee
commit
c210aa8a95
|
@ -20,9 +20,11 @@ import (
|
||||||
"github.com/jacobsa/fuse/internal/fusekernel"
|
"github.com/jacobsa/fuse/internal/fusekernel"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const outHeaderSize = unsafe.Sizeof(fusekernel.OutHeader{})
|
||||||
|
|
||||||
// We size out messages to be large enough to hold a header for the response
|
// We size out messages to be large enough to hold a header for the response
|
||||||
// plus the largest read that may come in.
|
// plus the largest read that may come in.
|
||||||
const outMessageSize = unsafe.Sizeof(fusekernel.OutHeader{}) + MaxReadSize
|
const outMessageSize = outHeaderSize + MaxReadSize
|
||||||
|
|
||||||
// OutMessage provides a mechanism for constructing a single contiguous fuse
|
// OutMessage provides a mechanism for constructing a single contiguous fuse
|
||||||
// message from multiple segments, where the first segment is always a
|
// message from multiple segments, where the first segment is always a
|
||||||
|
@ -37,7 +39,8 @@ type OutMessage struct {
|
||||||
// Reset the message so that it is ready to be used again. Afterward, the
|
// Reset the message so that it is ready to be used again. Afterward, the
|
||||||
// contents are solely a zeroed header.
|
// contents are solely a zeroed header.
|
||||||
func (m *OutMessage) Reset() {
|
func (m *OutMessage) Reset() {
|
||||||
panic("TODO")
|
m.offset = outHeaderSize
|
||||||
|
memclr(unsafe.Pointer(&m.storage), outHeaderSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a pointer to the header at the start of the message.
|
// Return a pointer to the header at the start of the message.
|
||||||
|
|
Loading…
Reference in New Issue