diff --git a/pool.go b/pool.go index 6e7a8c822acd68a9ba3d7073a820eb33bdae8f4c..e483a4ed8a813c142e2b6d2f02bd7bcc1a440129 100644 --- a/pool.go +++ b/pool.go @@ -21,6 +21,7 @@ package pool import ( + "math" "math/bits" "sync" ) @@ -29,7 +30,7 @@ import ( var GlobalPool = new(BufferPool) // MaxLength is the maximum length of an element that can be added to the Pool. -const MaxLength = 1 << 32 +const MaxLength = math.MaxInt32 // BufferPool is a pool to handle cases of reusing elements of varying sizes. It // maintains 32 internal pools, for each power of 2 in 0-32.