Skip to content

Commit

Permalink
cdc: recycle memory for unbounded channel (#9223)
Browse files Browse the repository at this point in the history
ref #9222
  • Loading branch information
hicqu authored Jun 14, 2023
1 parent 8503b05 commit 2473041
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/chann/chann.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func (ch *Chann[T]) Close() {
func (ch *Chann[T]) unboundedProcessing() {
var nilT T

ch.q = make([]T, 0, 1<<10)
for {
select {
case e, ok := <-ch.in:
Expand Down Expand Up @@ -208,9 +207,6 @@ func (ch *Chann[T]) unboundedProcessing() {
return
}
}
if cap(ch.q) < 1<<5 {
ch.q = make([]T, 0, 1<<10)
}
}
}

Expand Down

0 comments on commit 2473041

Please sign in to comment.