aboutsummaryrefslogtreecommitdiff
path: root/internal/bufpool/buffer.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 06:23:30 +0000
committerGravatar Runxi Yu2026-04-02 06:28:39 +0000
commita041d523de389b65b98a5373a8034041db2a8d83 (patch)
tree7b423dc735f463be616045f2c3c2095a7737aca7 /internal/bufpool/buffer.go
parentresearch: Add dynamic pack resources (diff)
signatureNo signature
*: Remove
Diffstat (limited to 'internal/bufpool/buffer.go')
-rw-r--r--internal/bufpool/buffer.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/internal/bufpool/buffer.go b/internal/bufpool/buffer.go
deleted file mode 100644
index b2d648a1..00000000
--- a/internal/bufpool/buffer.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package bufpool
-
-// Buffer is a growable byte container that optionally participates in a
-// memory pool. A Buffer may be obtained through Borrow() or constructed
-// directly from owned data via FromOwned().
-//
-// A Buffer's underlying slice may grow as needed. When finished with a
-// pooled buffer, the caller should invoke Release() to return it to the pool.
-//
-// Buffers must not be copied after first use; doing so can cause double-returns
-// to the pool and data races.
-//
-// In general, pass Buffer around when used internally, and directly .Bytes() when
-// returning output across our API boundary. It is neither necessary nor efficient
-// to copy/append the .Bytes() to a newly-allocated slice; in cases where we do
-// want the raw byte slice out of our API boundary, it is perfectly acceptable to
-// simply not call Release().
-//
-//go:nocopy
-type Buffer struct {
- _ struct{} // for nocopy
- buf []byte
- pool poolIndex
-}