Skip to content

Commit 5c22f5c

Browse files
committed
Support COW mapped_file_handle
1 parent cbf93aa commit 5c22f5c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

include/llfio/v2.0/detail/impl/posix/mapped_file_handle.ipp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ result<mapped_file_handle::size_type> mapped_file_handle::_reserve(extent_type &
5959
}
6060
// Reserve the full reservation in address space
6161
section_handle::flag mapflags = section_handle::flag::nocommit | section_handle::flag::read;
62+
mapflags |= _sh.section_flags() & section_handle::flag::cow;
6263
if(this->is_writable())
6364
{
6465
mapflags |= section_handle::flag::write;

include/llfio/v2.0/detail/impl/windows/mapped_file_handle.ipp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ result<mapped_file_handle::size_type> mapped_file_handle::_reserve(extent_type &
6363
return _reservation;
6464
}
6565
section_handle::flag mapflags = section_handle::flag::read;
66+
mapflags |= _sh.section_flags() & section_handle::flag::cow;
6667
auto map_size = reservation;
6768
// Reserve the full reservation in address space
6869
if(this->is_writable())

0 commit comments

Comments
 (0)