UnsafeLinkBuffer implements ReadWriter.
| 53 | |
| 54 | // UnsafeLinkBuffer implements ReadWriter. |
| 55 | type 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. |
| 73 | func (b *UnsafeLinkBuffer) Len() int { |
nothing calls this directly
no outgoing calls
no test coverage detected