MCPcopy Create free account
hub / github.com/couchbase/moss / AllocSet

Method AllocSet

segment.go:207–214  ·  view source on GitHub ↗

AllocSet is like Set(), but the caller must provide []byte parameters that came from Alloc(), for less buffer copying.

(keyFromAlloc, valFromAlloc []byte)

Source from the content-addressed store, hash-verified

205// AllocSet is like Set(), but the caller must provide []byte
206// parameters that came from Alloc(), for less buffer copying.
207func (a *segment) AllocSet(keyFromAlloc, valFromAlloc []byte) error {
208 bufCap := cap(a.buf)
209
210 keyStart := bufCap - cap(keyFromAlloc)
211
212 return a.mutateEx(OperationSet,
213 keyStart, len(keyFromAlloc), len(valFromAlloc))
214}
215
216// AllocDel is like Del(), but the caller must provide []byte
217// parameters that came from Alloc(), for less buffer copying.

Callers

nothing calls this directly

Calls 1

mutateExMethod · 0.95

Tested by

no test coverage detected