diff options
Diffstat (limited to 'internal/bufpool/consts.go')
| -rw-r--r-- | internal/bufpool/consts.go | 12 |
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 +) |
