|
|
| 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 |
| |
◆ memory_mapper_base()
| 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 |
|
) |
| |
|
inlineprotected |
- Parameters
-
| ptr | A pointer to the mapped memory. |
| is_writable | If the mapped memory writeable? If true, then the underlying file, as given by the 'file' parameters, must be writable. |
| offset | The starting offset within the container for the mapped region. |
| size | The number of mapped bytes. |
◆ data()
| std::shared_ptr<void> const& pstore::memory_mapper_base::data |
( |
| ) |
|
|
inline |
Returns the base address of this memory-mapped region.
Returns nullptr if unmap() has been called.
◆ end()
| std::uint64_t pstore::memory_mapper_base::end |
( |
| ) |
const |
|
inline |
A convenience method which returns the file offset of the end of the memory represented by this object.
◆ is_writable()
| bool pstore::memory_mapper_base::is_writable |
( |
| ) |
const |
|
inline |
Returns true if the memory is to be writable.
- Note
- The operating system may separately protect memory pages, so it's perfectly likely that a memory page may be read-only even if this method returns true.
◆ read_only()
| void pstore::memory_mapper_base::read_only |
( |
void * |
addr, |
|
|
std::size_t |
len |
|
) |
| |
|
virtual |
Marks the range of addresses given by addr and len as read-only.
This function validates the input parameter before calling read_only_impl() which is responsible for calling the real OS API.
- Parameters
-
| addr | A pointer that describes the starting page of the region of pages whose protection attributes are to be changed. |
| len | The size of the region whose protection attributes are to be changed |
- Note
- The function is virtual for mocking.
The documentation for this class was generated from the following files: