MCPcopy Create free account
hub / github.com/cloudwego/netpoll / UnsafeLinkBuffer

Struct UnsafeLinkBuffer

nocopy_linkbuffer.go:55–70  ·  view source on GitHub ↗

UnsafeLinkBuffer implements ReadWriter.

Source from the content-addressed store, hash-verified

53
54// UnsafeLinkBuffer implements ReadWriter.
55type UnsafeLinkBuffer struct {
56 length int64
57 mallocSize int
58
59 head *linkBufferNode // release head
60 read *linkBufferNode // read head
61 flush *linkBufferNode // malloc head
62 write *linkBufferNode // malloc tail
63
64 // buf allocated by Next when cross-package, which should be freed when release
65 caches [][]byte
66
67 // for `Peek` only, avoid creating too many []byte in `caches`
68 // fix the issue when we have a large buffer and we call `Peek` multiple times
69 cachePeek []byte
70}
71
72// Len implements Reader.
73func (b *UnsafeLinkBuffer) Len() int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected