MCPcopy
hub / github.com/google/gvisor / DeepClone

Method DeepClone

pkg/buffer/buffer.go:425–431  ·  view source on GitHub ↗

DeepClone creates a deep clone of b, copying data such that no bytes are shared with any other Buffers.

()

Source from the content-addressed store, hash-verified

423// DeepClone creates a deep clone of b, copying data such that no bytes are
424// shared with any other Buffers.
425func (b *Buffer) DeepClone() Buffer {
426 newBuf := Buffer{}
427 buf := b.Clone()
428 reader := buf.AsBufferReader()
429 newBuf.WriteFromReader(&reader, b.size)
430 return newBuf
431}
432
433// Apply applies the given function across all valid data.
434func (b *Buffer) Apply(fn func(*View)) {

Callers 2

WritePacketsMethod · 0.80
DeepCopyForForwardingMethod · 0.80

Calls 3

CloneMethod · 0.95
WriteFromReaderMethod · 0.95
AsBufferReaderMethod · 0.80

Tested by

no test coverage detected