|
pstore2
|
memory_mapper provides an operating system independent interface for memory mapping of files. More...
#include <memory_mapper.hpp>


Public Member Functions | |
| memory_mapper (file::file_handle &file, bool write_enabled, std::uint64_t offset, std::uint64_t length) | |
Public Member Functions inherited from pstore::memory_mapper_base | |
| memory_mapper_base (memory_mapper_base &&) noexcept=default | |
| memory_mapper_base (memory_mapper_base const &)=default | |
| memory_mapper_base & | operator= (memory_mapper_base &&) noexcept=default |
| memory_mapper_base & | operator= (memory_mapper_base const &)=default |
| bool | is_writable () const |
| Returns true if the memory is to be writable. More... | |
| std::uint64_t | offset () const |
| Returns the file offset of the start of the memory represented by this object. | |
| std::uint64_t | size () const |
| Returns the size of the memory region owned by this object. | |
| std::uint64_t | end () const |
| A convenience method which returns the file offset of the end of the memory represented by this object. More... | |
| virtual void | read_only (void *addr, std::size_t len) |
| Marks the range of addresses given by addr and len as read-only. More... | |
| std::shared_ptr< void > const & | data () |
| Returns the base address of this memory-mapped region. More... | |
| std::shared_ptr< void const > | data () const |
Additional Inherited Members | |
Static Public Member Functions inherited from pstore::memory_mapper_base | |
| static unsigned long | page_size (system_page_size_interface const &intf) |
Protected Member Functions inherited from pstore::memory_mapper_base | |
| memory_mapper_base (std::shared_ptr< void > ptr, bool const is_writable, std::uint64_t const offset, std::uint64_t const size) | |
memory_mapper provides an operating system independent interface for memory mapping of files.
The underlying constaints imposed by the OS are not affected. They are:
Linux: the 'offset' parameter must be a multiple of the value returned by sysconf(_SC_PAGESIZE) Windows: the 'offset' parameter must be a multiple of the allocation granularity given by SYSTEM_INFO structure filled in by a call to GetSystemInfo().
| pstore::memory_mapper::memory_mapper | ( | file::file_handle & | file, |
| bool | write_enabled, | ||
| std::uint64_t | offset, | ||
| std::uint64_t | length | ||
| ) |
| file | The file whose contents are to be mapped into memory. |
| write_enabled | Should the mapped memory be writeable? If true, then the underlying file, as given by the 'file' parameter, must be writable. |
| offset | The starting offset within the file for the mapped region. This value must be correctly aligned for the host OS. |
| length | The number of bytes to be mapped. |
1.8.13