do not capture pointers in ops queue closures (#2675)

This commit is contained in:
Paul Wells
2024-04-22 11:33:28 -07:00
committed by GitHub
parent 8117f92465
commit c4354575ec
4 changed files with 72 additions and 70 deletions
+2 -3
View File
@@ -81,13 +81,12 @@ type opsQueueBase[T opsQueueItem] struct {
}
func newOpsQueueBase[T opsQueueItem](params OpsQueueParams) *opsQueueBase[T] {
oq := &opsQueueBase[T]{
return &opsQueueBase[T]{
params: params,
ops: *deque.New[T](min(bits.Len64(uint64(params.MinSize-1)), 7)),
wake: make(chan struct{}, 1),
doneChan: make(chan struct{}),
}
oq.ops.SetMinCapacity(uint(min(bits.Len64(uint64(oq.params.MinSize-1)), 7)))
return oq
}
func (oq *opsQueueBase[T]) Start() {