memorySize return the real memory size in bytes the LinkBuffer occupied
()
| 825 | |
| 826 | // memorySize return the real memory size in bytes the LinkBuffer occupied |
| 827 | func (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 |
no outgoing calls