Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
edd33cfb
Commit
edd33cfb
authored
Dec 20, 2017
by
Pedro Gonnet
Committed by
Matthieu Schaller
Dec 21, 2017
Browse files
unmap all the bytes.
parent
608d393a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dump.c
View file @
edd33cfb
...
...
@@ -61,13 +61,13 @@ void dump_ensure(struct dump *d, size_t size) {
if
(
d
->
size
-
d
->
count
>
size
)
return
;
/* Unmap the current data. */
size_t
trunc_count
=
d
->
count
&
d
->
page_mask
;
if
(
munmap
(
d
->
data
,
trunc_count
>
0
?
trunc_count
:
1
)
!=
0
)
{
error
(
"Failed to unmap %zi bytes of dump data (%s)."
,
trunc_count
,
if
(
munmap
(
d
->
data
,
d
->
size
)
!=
0
)
{
error
(
"Failed to unmap %zi bytes of dump data (%s)."
,
d
->
size
,
strerror
(
errno
));
}
/* Update the size and count. */
const
size_t
trunc_count
=
d
->
count
&
d
->
page_mask
;
d
->
file_offset
+=
trunc_count
;
d
->
count
-=
trunc_count
;
d
->
size
=
(
size
*
dump_grow_ensure_factor
+
~
d
->
page_mask
)
&
d
->
page_mask
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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