Skip to content

Commit

Permalink
upgrade bytesPool, fixed #714
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Sep 18, 2023
1 parent 1c72db6 commit f6564ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
toolchain go1.21.1

require (
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230419012903-2f1f26674686
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230918115058-c72bd9761c57
github.com/go-chi/chi/v5 v5.0.10
github.com/google/nftables v0.1.0
github.com/kardianos/service v1.2.2
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230419012903-2f1f26674686 h1:5R32cCep3VUDTKf3aurFKfgbvg+RScuBmZsw/DyyXco=
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230419012903-2f1f26674686/go.mod h1:pQ/FSsWSNYmNdgIKmulKlmVC/R2PEpq2vIEi3J9IijI=
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230918113338-1af74a078e78 h1:Fem1OuBzs4A4kt/MPn09OjZKgphevSoBapSJR/40AzQ=
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230918113338-1af74a078e78/go.mod h1:pQ/FSsWSNYmNdgIKmulKlmVC/R2PEpq2vIEi3J9IijI=
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230918115058-c72bd9761c57 h1:nfurUSSmVY9sY/mYyoReOA1w2cR2fp2eicL9ojicZhQ=
github.com/IrineSistiana/go-bytes-pool v0.0.0-20230918115058-c72bd9761c57/go.mod h1:pQ/FSsWSNYmNdgIKmulKlmVC/R2PEpq2vIEi3J9IijI=
github.com/IrineSistiana/ipset v0.5.1-0.20220703061533-6e0fc3b04c0a h1:GQdh/h0q0ni3L//CXusyk+7QdhBL289vdNaes1WKkHI=
github.com/IrineSistiana/ipset v0.5.1-0.20220703061533-6e0fc3b04c0a/go.mod h1:rYF5DQLRGGoQ8ZSWeK+6eX5amAuPqwFkWjhQlEITGJQ=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down
6 changes: 3 additions & 3 deletions pkg/pool/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
bytesPool "github.com/IrineSistiana/go-bytes-pool"
)

// defaultBufPool is an Allocator that has a maximum capacity.
var (
GetBuf = bytesPool.Get
ReleaseBuf = bytesPool.Release
_pool = bytesPool.NewPool(10) // 1Mbyte pool, should be enough.
GetBuf = _pool.Get
ReleaseBuf = _pool.Release
)

0 comments on commit f6564ca

Please sign in to comment.