Commit Graph

5 Commits

Author SHA1 Message Date
Paul Chesnais f8e5d8f704
mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them (#7702)
* Address #7631 by correctly pooling large-capacity buffers

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.

---------

Co-authored-by: Purnesh Dixit <purneshdixit@google.com>
Co-authored-by: Easwar Swaminathan <easwars@google.com>
2024-10-24 22:44:00 +05:30
Purnesh Dixit 04e78b0faf
.*: fix lint issues of not having comments for exported funcs and vars along with any remaining issues and enable remaining disabled rules (#7575)
* .*: fix lint issues of not having comments for exported funcs and vars along with any remaining issues and enable remaining disabled rules
2024-09-16 09:09:49 +05:30
Arvind Bright 8320224ff0
.*: revive from unused_parameters (#7577) 2024-08-30 10:41:30 -07:00
Paul Chesnais 9ab8b62505
Implement new Codec that uses `mem.BufferSlice` instead of `[]byte` (#7356) 2024-08-21 14:11:39 -07:00
Paul Chesnais 887d908264
mem: introduce `mem` package to facilitate memory reuse (#7432) 2024-08-01 14:14:30 -07:00