diff options
| author | 2025-11-25 08:00:00 +0800 | |
|---|---|---|
| committer | 2025-11-25 08:00:00 +0800 | |
| commit | 94a6325ee646be4a06ca0646fcd797b2a9c74581 (patch) | |
| tree | 1b9dd5018a7c5871e9f8204b7b6899006ce1d4c7 /internal/flatex/slice_inflate.go | |
| parent | flatex: Remove unused cruft (diff) | |
| signature | No signature | |
flatex: Restructure a little
Diffstat (limited to 'internal/flatex/slice_inflate.go')
| -rw-r--r-- | internal/flatex/slice_inflate.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/flatex/slice_inflate.go b/internal/flatex/slice_inflate.go index 3e07e744..f9120143 100644 --- a/internal/flatex/slice_inflate.go +++ b/internal/flatex/slice_inflate.go @@ -3,6 +3,7 @@ package flatex import ( "io" "math/bits" + "sync" ) // sliceInflater is a specialized DEFLATE decoder that reads directly from an @@ -33,6 +34,16 @@ type sliceInflater struct { copyDist int } +var sliceInflaterPool = sync.Pool{ + New: func() any { + fixedHuffmanDecoderInit() + return &sliceInflater{ + bits: new([maxNumLit + maxNumDist]int), + codebits: new([numCodes]int), + } + }, +} + func (f *sliceInflater) reset(src []byte) error { bits := f.bits codebits := f.codebits |
