NewBytesQueue initialize new bytes queue. capacity is used in bytes array allocation When verbose flag is set then information about memory allocation are printed
(capacity int, maxCapacity int, verbose bool)
| 61 | // capacity is used in bytes array allocation |
| 62 | // When verbose flag is set then information about memory allocation are printed |
| 63 | func NewBytesQueue(capacity int, maxCapacity int, verbose bool) *BytesQueue { |
| 64 | return &BytesQueue{ |
| 65 | array: make([]byte, capacity), |
| 66 | capacity: capacity, |
| 67 | maxCapacity: maxCapacity, |
| 68 | headerBuffer: make([]byte, binary.MaxVarintLen32), |
| 69 | tail: leftMarginIndex, |
| 70 | head: leftMarginIndex, |
| 71 | rightMargin: leftMarginIndex, |
| 72 | verbose: verbose, |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // Reset removes all entries from queue |
| 77 | func (q *BytesQueue) Reset() { |
no outgoing calls
searching dependent graphs…