MCPcopy Index your code
hub / github.com/allegro/bigcache / NewBytesQueue

Function NewBytesQueue

queue/bytes_queue.go:63–74  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

61// capacity is used in bytes array allocation
62// When verbose flag is set then information about memory allocation are printed
63func 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
77func (q *BytesQueue) Reset() {

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…