MCPcopy
hub / github.com/grpc/grpc-go / newQueuePair

Function newQueuePair

internal/profiling/buffer/buffer.go:77–83  ·  view source on GitHub ↗

Allocates and returns a new *queuePair with its internal queues allocated.

(size uint32)

Source from the content-addressed store, hash-verified

75
76// Allocates and returns a new *queuePair with its internal queues allocated.
77func newQueuePair(size uint32) *queuePair {
78 qp := &queuePair{}
79 qp.q0 = unsafe.Pointer(newQueue(size))
80 qp.q1 = unsafe.Pointer(newQueue(size))
81 qp.q = qp.q0
82 return qp
83}
84
85// Switches the current queue for future Pushes to proceed to the other queue
86// so that there's no blocking in Push. Returns a pointer to the old queue that

Callers 1

NewCircularBufferFunction · 0.85

Calls 1

newQueueFunction · 0.85

Tested by

no test coverage detected