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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
3f814c0b
Commit
3f814c0b
authored
Dec 09, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c52b5571
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
wcfs/internal/wcfs.h
wcfs/internal/wcfs.h
+4
-4
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+2
-1
No files found.
wcfs/internal/wcfs.h
View file @
3f814c0b
...
...
@@ -42,7 +42,7 @@ using std::pair;
// from wendelin/bigfile/virtmem.h
extern
"C"
{
struct
BigFileH
;
struct
VMA
;
}
...
...
@@ -144,7 +144,7 @@ public:
void
decref
();
public:
pair
<
Mapping
,
error
>
mmap
(
int64_t
blk_start
,
int64_t
blk_len
);
pair
<
Mapping
,
error
>
mmap
(
int64_t
blk_start
,
int64_t
blk_len
,
VMA
*
vma
=
nil
);
};
// Mapping represents one mapping of FileH.
...
...
@@ -153,9 +153,9 @@ struct _Mapping : object {
FileH
fileh
;
int64_t
blk_start
;
// offset of this mapping in file
BigFileH
*
virt_fileh
;
// mmapped under this virtmem file handle XXX -> VMA XXX can be nil
uint8_t
*
mem_start
;
// mmapped memory [mem_start, mem_stop)
uint8_t
*
mem_stop
;
VMA
*
vma
;
// mmapped under this virtmem VMA | nil if created standalone from virtmem
int64_t
blk_stop
()
const
{
//XXX reenable
...
...
@@ -171,7 +171,7 @@ struct _Mapping : object {
private:
_Mapping
();
~
_Mapping
();
friend
pair
<
Mapping
,
error
>
_FileH
::
mmap
(
int64_t
blk_start
,
int64_t
blk_len
);
friend
pair
<
Mapping
,
error
>
_FileH
::
mmap
(
int64_t
blk_start
,
int64_t
blk_len
,
VMA
*
vma
);
public:
void
decref
();
};
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
3f814c0b
...
...
@@ -289,7 +289,7 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
}
// mmap creates file mapping representing file[blk_start +blk_len) data as of wconn.at database state.
pair
<
Mapping
,
error
>
_FileH
::
mmap
(
int64_t
blk_start
,
int64_t
blk_len
)
{
pair
<
Mapping
,
error
>
_FileH
::
mmap
(
int64_t
blk_start
,
int64_t
blk_len
,
VMA
*
vma
)
{
_FileH
&
f
=
*
this
;
// XXX err ctx
// XXX (blk_start + blk_len) * blk_size overflow
...
...
@@ -326,6 +326,7 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len) {
mmap
->
blk_start
=
blk_start
;
mmap
->
mem_start
=
mem_start
;
mmap
->
mem_stop
=
mem_stop
;
mmap
->
vma
=
vma
;
for
(
auto
_
:
f
.
_pinned
)
{
// XXX keep f._pinned ↑blk and use binary search?
int64_t
blk
=
_
.
first
;
...
...
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