MCPcopy
hub / github.com/grpc/grpc-go / buffer

Struct buffer

mem/buffers.go:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78type buffer struct {
79 refs atomic.Int32
80 data []byte
81
82 // rootBuf is the buffer responsible for returning origData to the pool
83 // once the reference count drops to 0.
84 //
85 // When a buffer is split, the new buffer inherits the rootBuf of the
86 // original and increments the root's reference count. For the
87 // initial buffer (the root), this field points to itself.
88 rootBuf *buffer
89
90 // The following fields are only set for root buffers.
91 origData *[]byte
92 pool BufferPool
93}
94
95func newBuffer() *buffer {
96 return bufferObjectPool.Get().(*buffer)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected