Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e16a7ef6
Commit
e16a7ef6
authored
May 23, 2017
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: capped int pool
parent
a816e756
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
intpool.go
core/vm/intpool.go
+6
-0
No files found.
core/vm/intpool.go
View file @
e16a7ef6
...
...
@@ -20,6 +20,8 @@ import "math/big"
var
checkVal
=
big
.
NewInt
(
-
42
)
const
poolLimit
=
256
// intPool is a pool of big integers that
// can be reused for all big.Int operations.
type
intPool
struct
{
...
...
@@ -37,6 +39,10 @@ func (p *intPool) get() *big.Int {
return
new
(
big
.
Int
)
}
func
(
p
*
intPool
)
put
(
is
...*
big
.
Int
)
{
if
len
(
p
.
pool
.
data
)
>
poolLimit
{
return
}
for
_
,
i
:=
range
is
{
// verifyPool is a build flag. Pool verification makes sure the integrity
// of the integer pool by comparing values to a default value.
...
...
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