Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-buffer-pool
Commits
2ad47e56
Commit
2ad47e56
authored
Oct 04, 2018
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix overflow on 32-bit platforms.
parent
1d28ab5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
pool.go
pool.go
+2
-1
No files found.
pool.go
View file @
2ad47e56
...
...
@@ -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
.
MaxInt
32
// 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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment