From 374ca2159407c6f3ec786bc19e25da44ded62fcf Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 6 Mar 2026 11:22:29 +0800 Subject: internal/bufpool: Split files --- internal/bufpool/consts.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 internal/bufpool/consts.go (limited to 'internal/bufpool/consts.go') diff --git a/internal/bufpool/consts.go b/internal/bufpool/consts.go new file mode 100644 index 00000000..4c205879 --- /dev/null +++ b/internal/bufpool/consts.go @@ -0,0 +1,12 @@ +package bufpool + +const ( + // DefaultBufferCap is the minimum capacity a borrowed buffer will have. + // Borrow() will allocate or retrieve a buffer with at least this capacity. + DefaultBufferCap = 32 * 1024 + + // maxPooledBuffer defines the maximum capacity of a buffer that may be + // returned to the pool. Buffers larger than this will not be pooled to + // avoid unbounded memory usage. + maxPooledBuffer = 8 << 20 +) -- cgit v1.3.1-10-gc9f91