diff options
| author | 2026-03-06 11:22:29 +0800 | |
|---|---|---|
| committer | 2026-03-06 11:22:29 +0800 | |
| commit | 374ca2159407c6f3ec786bc19e25da44ded62fcf (patch) | |
| tree | 4af6ccdb5057f84f0b55a2151231a8f33ed4b41e /internal/bufpool/from_owned.go | |
| parent | diff/lines: Split files (diff) | |
| signature | No signature | |
internal/bufpool: Split files
Diffstat (limited to 'internal/bufpool/from_owned.go')
| -rw-r--r-- | internal/bufpool/from_owned.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/bufpool/from_owned.go b/internal/bufpool/from_owned.go new file mode 100644 index 00000000..65c5f471 --- /dev/null +++ b/internal/bufpool/from_owned.go @@ -0,0 +1,8 @@ +package bufpool + +// FromOwned constructs a Buffer from a caller-owned byte slice. The resulting +// Buffer does not participate in pooling and will never be returned to the +// internal pool when released. +func FromOwned(buf []byte) Buffer { + return Buffer{buf: buf, pool: unpooled} +} |
