diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2021-11-05 10:40:53 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-11-05 10:43:49 -0700 |
commit | ce4f4283badb6b07baf9f8e6d99e7a5fd15c92db (patch) | |
tree | 848dc50da62da59dc4a5781f9eb7461c58b71512 /pkg/lisafs/client.go | |
parent | 822a647018adbd994114cb0dc8932f2853b805aa (diff) |
Make {Un}Marshal{Bytes/Unsafe} return remaining buffer.
Change marshal.Marshallable method signatures to return the remaining buffer.
This makes it easier to implement these method manually. Without this, we would
have to manually do buffer shifting which is error prone.
tools/go_marshal/test:benchmark test does not show change in performance.
Additionally fixed some marshalling bugs in fsimpl/fuse.
Updated multiple callpoints to get rid of redundant slice indexing work and
simplified code using this new signature.
Updates #6450
PiperOrigin-RevId: 407857019
Diffstat (limited to 'pkg/lisafs/client.go')
-rw-r--r-- | pkg/lisafs/client.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/lisafs/client.go b/pkg/lisafs/client.go index ccf1b9f72..e0f278b5c 100644 --- a/pkg/lisafs/client.go +++ b/pkg/lisafs/client.go @@ -313,7 +313,7 @@ func (c *Client) SyncFDs(ctx context.Context, fds []FDID) error { // implicit conversion to an interface leads to an allocation. // // Precondition: reqMarshal and respUnmarshal must be non-nil. -func (c *Client) SndRcvMessage(m MID, payloadLen uint32, reqMarshal func(dst []byte), respUnmarshal func(src []byte), respFDs []int) error { +func (c *Client) SndRcvMessage(m MID, payloadLen uint32, reqMarshal func(dst []byte) []byte, respUnmarshal func(src []byte) []byte, respFDs []int) error { if !c.IsSupported(m) { return unix.EOPNOTSUPP } |