aboutsummaryrefslogtreecommitdiff
path: root/internal/bufpool/consts.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 11:22:29 +0800
committerGravatar Runxi Yu2026-03-06 11:22:29 +0800
commit374ca2159407c6f3ec786bc19e25da44ded62fcf (patch)
tree4af6ccdb5057f84f0b55a2151231a8f33ed4b41e /internal/bufpool/consts.go
parentdiff/lines: Split files (diff)
signatureNo signature
internal/bufpool: Split files
Diffstat (limited to 'internal/bufpool/consts.go')
-rw-r--r--internal/bufpool/consts.go12
1 files changed, 12 insertions, 0 deletions
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
+)