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

Function MakeWithView

pkg/buffer/buffer.go:55–68  ·  view source on GitHub ↗

MakeWithView creates a new Buffer initialized with given view. This function takes ownership of v.

(v *View)

Source from the content-addressed store, hash-verified

53// MakeWithView creates a new Buffer initialized with given view. This function
54// takes ownership of v.
55func MakeWithView(v *View) Buffer {
56 if v == nil {
57 return Buffer{}
58 }
59 b := Buffer{
60 size: int64(v.Size()),
61 }
62 if b.size == 0 {
63 v.Release()
64 return b
65 }
66 b.data.PushBack(v)
67 return b
68}
69
70// Release frees all resources held by b.
71func (b *Buffer) Release() {

Callers 15

writeFrameMethod · 0.92
dispatchLoopMethod · 0.92
dispatchLoopMethod · 0.92
WriteMethod · 0.92
dispatchMethod · 0.92
readMMappedPacketsMethod · 0.92
HandlePacketMethod · 0.92
TestSegmentMergeFunction · 0.92
SendICMPPacketMethod · 0.92
writePacketInnerMethod · 0.92
sendNDPNSMethod · 0.92

Calls 3

SizeMethod · 0.65
ReleaseMethod · 0.65
PushBackMethod · 0.45

Tested by 2

TestSegmentMergeFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…