LLFIO v2.00
Loading...
Searching...
No Matches
map_handle.hpp File Reference

Provides `map_handle`. More...

#include "file_handle.hpp"

Classes

class  llfio_v2_xxx::section_handle
 A handle to a source of mapped memory. More...
 
struct  llfio_v2_xxx::construct< section_handle >
 Constructor for section_handle More...
 
class  llfio_v2_xxx::map_handle
 A handle to a memory mapped region of memory, either backed by the system page file or by a section. More...
 
struct  llfio_v2_xxx::map_handle::cache_statistics
 Statistics about the map handle cache. More...
 
struct  llfio_v2_xxx::construct< map_handle >
 Constructor for map_handle More...
 
struct  in_place_attach_detach::traits::disable_attached_for< llfio_v2_xxx ::map_handle >
 

Namespaces

namespace  llfio_v2_xxx
 The LLFIO namespace.
 

Functions

std::ostream & llfio_v2_xxx::operator<< (std::ostream &s, const section_handle::flag &v)
 
byte_io_handle::const_buffer_type llfio_v2_xxx::nvram_barrier (byte_io_handle::const_buffer_type req, bool evict=false) noexcept
 
template<class T >
constexpr span< T > llfio_v2_xxx::in_place_attach (map_handle &mh) noexcept
 Declare map_handle as a suitable source for P1631 attached<T>.
 
void llfio_v2_xxx::swap (section_handle &self, section_handle &o) noexcept
 Swap with another instance.
 
result< section_handlellfio_v2_xxx::section (file_handle &backing, section_handle::extent_type maximum_size, section_handle::flag _flag) noexcept
 Create a memory section backed by a file.
 
result< section_handlellfio_v2_xxx::section (file_handle &backing, section_handle::extent_type bytes=0) noexcept
 Create a memory section backed by a file.
 
result< section_handlellfio_v2_xxx::section (section_handle::extent_type bytes, const path_handle &dirh=path_discovery::storage_backed_temporary_files_directory(), section_handle::flag _flag=section_handle::flag::read|section_handle::flag::write) noexcept
 Create a memory section backed by an anonymous, managed file.
 
result< section_handle::extent_type > llfio_v2_xxx::length (const section_handle &self) noexcept
 Return the current maximum permitted extent of the memory section.
 
result< section_handle::extent_type > llfio_v2_xxx::truncate (section_handle &self, section_handle::extent_type newsize=0) noexcept
 
void llfio_v2_xxx::swap (map_handle &self, map_handle &o) noexcept
 Swap with another instance.
 
result< void > llfio_v2_xxx::close (map_handle &self) noexcept
 Unmap the mapped view.
 
result< map_handlellfio_v2_xxx::map (map_handle::size_type bytes, bool zeroed=false, section_handle::flag _flag=section_handle::flag::readwrite) noexcept
 
result< map_handlellfio_v2_xxx::map (section_handle &section, map_handle::size_type bytes=0, map_handle::extent_type offset=0, section_handle::flag _flag=section_handle::flag::readwrite) noexcept
 
map_handle::size_type llfio_v2_xxx::length (const map_handle &self) noexcept
 The size of the memory map. This is the accessible size, NOT the reservation size.
 
result< map_handle::size_type > llfio_v2_xxx::truncate (map_handle &self, map_handle::size_type newsize, bool permit_relocation=false) noexcept
 
map_handle::io_result< map_handle::buffers_type > llfio_v2_xxx::read (map_handle &self, map_handle::io_request< map_handle::buffers_type > reqs, deadline d=deadline()) noexcept
 Read data from the mapped view.
 
map_handle::io_result< map_handle::const_buffers_type > llfio_v2_xxx::write (map_handle &self, map_handle::io_request< map_handle::const_buffers_type > reqs, deadline d=deadline()) noexcept
 Write data to the mapped view.
 
result< size_t > llfio_v2_xxx::detail::pagesize_from_flags (section_handle::flag _flag) noexcept
 

Detailed Description

Provides `map_handle`.

Function Documentation

◆ pagesize_from_flags()

result< size_t > llfio_v2_xxx::detail::pagesize_from_flags ( section_handle::flag  _flag)
inlinenoexcept
1125 {
1126 LLFIO_EXCEPTION_TRY
1127 {
1128 const auto &pagesizes = utils::page_sizes();
1129 if((_flag & section_handle::flag::page_sizes_3) == section_handle::flag::page_sizes_3)
1130 {
1131 if(pagesizes.size() < 4)
1132 {
1133 return errc::invalid_argument;
1134 }
1135 return pagesizes[3];
1136 }
1137 else if((_flag & section_handle::flag::page_sizes_2) == section_handle::flag::page_sizes_2)
1138 {
1139 if(pagesizes.size() < 3)
1140 {
1141 return errc::invalid_argument;
1142 }
1143 return pagesizes[2];
1144 }
1145 else if((_flag & section_handle::flag::page_sizes_1) == section_handle::flag::page_sizes_1)
1146 {
1147 if(pagesizes.size() < 2)
1148 {
1149 return errc::invalid_argument;
1150 }
1151 return pagesizes[1];
1152 }
1153 return pagesizes[0];
1154 }
1155 LLFIO_EXCEPTION_CATCH_ALL
1156 {
1157 return error_from_exception();
1158 }
1159 }