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
65e1095c
Unverified
Commit
65e1095c
authored
Apr 14, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consensus/ethash: close mmap before rename, windows limitation
parent
ee05cc4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
ethash.go
consensus/ethash/ethash.go
+8
-5
No files found.
consensus/ethash/ethash.go
View file @
65e1095c
...
@@ -130,13 +130,16 @@ func memoryMapAndGenerate(path string, size uint64, generator func(buffer []uint
...
@@ -130,13 +130,16 @@ func memoryMapAndGenerate(path string, size uint64, generator func(buffer []uint
data
:=
buffer
[
len
(
dumpMagic
)
:
]
data
:=
buffer
[
len
(
dumpMagic
)
:
]
generator
(
data
)
generator
(
data
)
if
err
:=
mem
.
Flush
();
err
!=
nil
{
if
err
:=
mem
.
Unmap
();
err
!=
nil
{
mem
.
Unmap
()
return
nil
,
nil
,
nil
,
err
dump
.
Close
()
}
if
err
:=
dump
.
Close
();
err
!=
nil
{
return
nil
,
nil
,
nil
,
err
}
if
err
:=
os
.
Rename
(
temp
,
path
);
err
!=
nil
{
return
nil
,
nil
,
nil
,
err
return
nil
,
nil
,
nil
,
err
}
}
os
.
Rename
(
temp
,
path
)
return
memoryMap
(
path
)
return
dump
,
mem
,
data
,
nil
}
}
// cache wraps an ethash cache with some metadata to allow easier concurrent use.
// cache wraps an ethash cache with some metadata to allow easier concurrent use.
...
...
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