grpc-go
grpc-go copied to clipboard
mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them
Fixes #7631
As the issue states, mem.NewBuffer would not pool buffers with a length below the pooling threshold but whose capacity is actually larger than the pooling threshold. This can lead to buffers being leaked.
RELEASE NOTES:
- mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them