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

Method AllocMerge

segment.go:229–236  ·  view source on GitHub ↗

AllocMerge is like Merge(), 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

227// AllocMerge is like Merge(), but the caller must provide []byte
228// parameters that came from Alloc(), for less buffer copying.
229func (a *segment) AllocMerge(keyFromAlloc, valFromAlloc []byte) error {
230 bufCap := cap(a.buf)
231
232 keyStart := bufCap - cap(keyFromAlloc)
233
234 return a.mutateEx(OperationMerge,
235 keyStart, len(keyFromAlloc), len(valFromAlloc))
236}
237
238// ------------------------------------------------------
239

Callers

nothing calls this directly

Calls 1

mutateExMethod · 0.95

Tested by

no test coverage detected