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

Method memorySize

nocopy_linkbuffer.go:827–836  ·  view source on GitHub ↗

memorySize return the real memory size in bytes the LinkBuffer occupied

()

Source from the content-addressed store, hash-verified

825
826// memorySize return the real memory size in bytes the LinkBuffer occupied
827func (b *LinkBuffer) memorySize() (bytes int) {
828 for node := b.head; node != nil; node = node.next {
829 bytes += cap(node.buf)
830 }
831 for _, c := range b.caches {
832 bytes += cap(c)
833 }
834 bytes += cap(b.cachePeek)
835 return bytes
836}
837
838// ------------------------------------------ implement link node ------------------------------------------
839

Callers 1

Calls

no outgoing calls

Tested by 1