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

Method Release

nocopy_linkbuffer.go:274–293  ·  view source on GitHub ↗

Release the node that has been read. b.flush == nil indicates that this LinkBuffer is created by LinkBuffer.Slice

()

Source from the content-addressed store, hash-verified

272// Release the node that has been read.
273// b.flush == nil indicates that this LinkBuffer is created by LinkBuffer.Slice
274func (b *UnsafeLinkBuffer) Release() (err error) {
275 for b.read != b.flush && b.read.Len() == 0 {
276 b.read = b.read.next
277 }
278 for b.head != b.read {
279 node := b.head
280 b.head = b.head.next
281 node.Release()
282 }
283 for i := range b.caches {
284 free(b.caches[i])
285 b.caches[i] = nil
286 }
287 b.caches = b.caches[:0]
288 if b.cachePeek != nil {
289 free(b.cachePeek)
290 b.cachePeek = nil
291 }
292 return nil
293}
294
295// ReadString implements Reader.
296func (b *UnsafeLinkBuffer) ReadString(n int) (s string, err error) {

Callers 2

SliceMethod · 0.95
CloseMethod · 0.95

Calls 3

freeFunction · 0.85
LenMethod · 0.65
ReleaseMethod · 0.65

Tested by

no test coverage detected