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
a3267ed9
Unverified
Commit
a3267ed9
authored
Jun 11, 2018
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trie: don't report the root flushlist as an alloc
parent
9f7592c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
database.go
trie/database.go
+2
-2
No files found.
trie/database.go
View file @
a3267ed9
...
...
@@ -297,7 +297,7 @@ func (db *Database) Cap(limit common.StorageSize) error {
// db.nodesSize only contains the useful data in the cache, but when reporting
// the total memory consumption, the maintenance metadata is also needed to be
// counted. For every useful node, we track 2 extra hashes as the flushlist.
size
:=
db
.
nodesSize
+
common
.
StorageSize
(
len
(
db
.
nodes
)
*
2
*
common
.
HashLength
)
size
:=
db
.
nodesSize
+
common
.
StorageSize
(
(
len
(
db
.
nodes
)
-
1
)
*
2
*
common
.
HashLength
)
// If the preimage cache got large enough, push to disk. If it's still small
// leave for later to deduplicate writes.
...
...
@@ -512,6 +512,6 @@ func (db *Database) Size() (common.StorageSize, common.StorageSize) {
// db.nodesSize only contains the useful data in the cache, but when reporting
// the total memory consumption, the maintenance metadata is also needed to be
// counted. For every useful node, we track 2 extra hashes as the flushlist.
var
flushlistSize
=
common
.
StorageSize
(
len
(
db
.
nodes
)
*
2
*
common
.
HashLength
)
var
flushlistSize
=
common
.
StorageSize
(
(
len
(
db
.
nodes
)
-
1
)
*
2
*
common
.
HashLength
)
return
db
.
nodesSize
+
flushlistSize
,
db
.
preimagesSize
}
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