MCPcopy
hub / github.com/kopia/kopia / Reset

Method Reset

internal/gather/gather_write_buffer.go:66–81  ·  view source on GitHub ↗

Reset resets buffer back to empty.

()

Source from the content-addressed store, hash-verified

64
65// Reset resets buffer back to empty.
66func (b *WriteBuffer) Reset() {
67 b.mu.Lock()
68 defer b.mu.Unlock()
69
70 if b.alloc != nil {
71 for _, s := range b.inner.Slices {
72 b.alloc.releaseChunk(s)
73 }
74 }
75
76 b.inner.invalidate()
77
78 b.alloc = nil
79
80 b.inner = Bytes{}
81}
82
83// Write implements io.Writer for appending to the buffer.
84func (b *WriteBuffer) Write(data []byte) (n int, err error) {

Callers 14

runBenchmarkMethod · 0.95
runBenchmarkMethod · 0.95
runBenchmarkMethod · 0.95
runDecompressionMethod · 0.95
TestGatherBytesFunction · 0.95
MakeContiguousMethod · 0.95
TestGatherWriteBufferFunction · 0.95
getParametersMethod · 0.95
PrefetchContentsMethod · 0.95
fetchIndexBlobsMethod · 0.95
ListActiveSessionsMethod · 0.95

Calls 4

releaseChunkMethod · 0.80
invalidateMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65

Tested by 3

TestGatherBytesFunction · 0.76
TestGatherWriteBufferFunction · 0.76