Commit 2ad47e56 authored by Kevin Atkinson's avatar Kevin Atkinson

Fix overflow on 32-bit platforms.

parent 1d28ab5f
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment