Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
7d989da3
Commit
7d989da3
authored
Jul 11, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0ff122c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+7
-5
No files found.
bigfile/tests/test_virtmem.c
View file @
7d989da3
...
...
@@ -225,7 +225,7 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
/* _pagev_str returns string representation for vector of pages.
*
the
memory has to be freed by user. */
*
returned
memory has to be freed by user. */
char
*
_pagev_str
(
Page
**
pagev
,
int
pagec
)
{
char
*
vstr
;
size_t
_
;
FILE
*
w
=
open_memstream
(
&
vstr
,
&
_
);
...
...
@@ -257,7 +257,7 @@ void _assert_pagev(const char *subj, Page **vok, int nok, Page **pagev, int n,
free
(
vstr
);
}
/* _check_mru checks that ram has MRU pages as specified by
pagev
. */
/* _check_mru checks that ram has MRU pages as specified by
mruok
. */
void
_check_mru
(
RAM
*
ram
,
Page
*
mruok
[],
int
nok
,
const
char
*
func
,
const
char
*
file
,
int
line
)
{
Page
**
mruv
=
NULL
;
int
n
=
0
;
...
...
@@ -265,8 +265,9 @@ void _check_mru(RAM *ram, Page *mruok[], int nok, const char *func, const char *
// collect mruv
list_for_each_backwardly
(
h
,
&
ram
->
lru_list
)
{
n
++
;
mruv
=
realloc
(
mruv
,
n
*
sizeof
(
*
mruv
));
mruv
[
n
++
]
=
list_entry
(
h
,
Page
,
lru
);
mruv
[
n
-
1
]
=
list_entry
(
h
,
Page
,
lru
);
}
_assert_pagev
(
"check_mru"
,
mruok
,
nok
,
mruv
,
n
,
func
,
file
,
line
);
...
...
@@ -281,7 +282,7 @@ void _check_mru(RAM *ram, Page *mruok[], int nok, const char *func, const char *
/* _check_dirty checks that fileh has dirty pages as specified.
* the order of dirty list traversal is to go through most recently dirtied pages first */
* the order of dirty list traversal is to go through most recently dirtied pages first
.
*/
void
_check_dirty
(
BigFileH
*
fileh
,
Page
*
dirtyok
[],
int
nok
,
const
char
*
func
,
const
char
*
file
,
int
line
)
{
Page
**
dirtyv
=
NULL
;
int
n
=
0
;
...
...
@@ -289,8 +290,9 @@ void _check_dirty(BigFileH *fileh, Page *dirtyok[], int nok, const char *func, c
// collect dirtyv
list_for_each_backwardly
(
h
,
&
fileh
->
dirty_pages
)
{
n
++
;
dirtyv
=
realloc
(
dirtyv
,
n
*
sizeof
(
*
dirtyv
));
dirtyv
[
n
++
]
=
list_entry
(
h
,
Page
,
in_dirty
);
dirtyv
[
n
-
1
]
=
list_entry
(
h
,
Page
,
in_dirty
);
}
_assert_pagev
(
"check_dirty"
,
dirtyok
,
nok
,
dirtyv
,
n
,
func
,
file
,
line
);
...
...
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