Skip to content

Commit

Permalink
upgrade github.com/klauspost/compress to v1.11.6
Browse files Browse the repository at this point in the history
This version has a fix that makes decoder.Reset(nil) release resources:
klauspost/compress@fa5ea64
  • Loading branch information
mostynb committed Jan 7, 2021
1 parent ff1866e commit 66ec463
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions decoderpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ type DecoderWrapper struct {
// be reused), but instead resets it and places this *DecoderWrapper back in
// the pool.
func (w *DecoderWrapper) Close() {
// FIXME: https://github.com/klauspost/compress/issues/296
w.Decoder.Reset(nil)

w.pool.Put(w)
err := w.Decoder.Reset(nil)
if err != nil {
w.pool.Put(w)
}
}

// IOReadCloser returns an io.ReadCloser that will return this *DecoderWrapper
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/mostynb/zstdpool-syncpool

go 1.15

require github.com/klauspost/compress v1.11.4
require github.com/klauspost/compress v1.11.6
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/klauspost/compress v1.11.4 h1:kz40R/YWls3iqT9zX9AHN3WoVsrAWVyui5sxuLqiXqU=
github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.6 h1:EgWPCW6O3n1D5n99Zq3xXBt9uCwRGvpwGOusOLNBRSQ=
github.com/klauspost/compress v1.11.6/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=

0 comments on commit 66ec463

Please sign in to comment.