|
|
| PSTORE_STATIC_ASSERT (full_region_size % min_region_size==0) |
| |
|
template<typename File > |
| | storage (std::shared_ptr< File > const &file, std::unique_ptr< system_page_size_interface > &&page_size, std::unique_ptr< region::factory > &®ion_factory) |
| |
|
template<typename File > |
| | storage (std::shared_ptr< File > const &file) |
| |
|
file::file_base * | file () noexcept |
| |
|
file::file_base const * | file () const noexcept |
| |
|
void | map_bytes (std::uint64_t new_size) |
| |
| void | update_master_pointers (std::size_t old_length) |
| | Called to add newly created memory-mapped regions to the segment address table. More...
|
| |
| template<typename Traits , typename Function > |
| void | copy (address addr, std::size_t size, typename Traits::temp_pointer p, Function copier) const |
| | This function performs the bulk of the work of creating a "shadow" block when a request spans more than one memory-mapped region (or when PSTORE_ALWAYS_SPANNING is enabled). More...
|
| |
| bool | request_spans_regions (address const &addr, std::size_t size) const noexcept |
| | Returns true if the given address range "spans" more than one region. More...
|
| |
|
void | protect (address first, address last) |
| | Marks the address range [first, last) as read-only.
|
| |
|
region_container const & | regions () const |
| |
|
| std::shared_ptr< void const > | segment_base (address::segment_type const segment) const noexcept |
| |
|
std::shared_ptr< void > const & | segment_base (address::segment_type const segment) noexcept |
| |
|
|
std::shared_ptr< void const > | address_to_pointer (address const addr) const noexcept |
| |
|
std::shared_ptr< void > | address_to_pointer (address const addr) noexcept |
| |
|
template<typename T > |
| std::shared_ptr< T const > | address_to_pointer (typed_address< T > addr) const noexcept |
| |
|
template<typename T > |
| std::shared_ptr< T > | address_to_pointer (typed_address< T > addr) noexcept |
| |
template<typename Traits , typename Function >
| void pstore::storage::copy |
( |
address |
addr, |
|
|
std::size_t |
size, |
|
|
typename Traits::temp_pointer |
p, |
|
|
Function |
copier |
|
) |
| const |
This function performs the bulk of the work of creating a "shadow" block when a request spans more than one memory-mapped region (or when PSTORE_ALWAYS_SPANNING is enabled).
It breaks the data into a series of copies (each read or writing as much data as possible) and calls the provided "copier" function to perform the actual copy. This same function is used to copy data from the store into a newly allocated block, and to copy from a contiguous block back to the store.
The template traits argument controls the direction of copy: either copy_from_store_traits or copy_to_store_traits may be used.
- Parameters
-
| addr | The store address of the data to be copied. |
| size | The number of bytes to be copied. |
| p | A pointer to a block of memory of at least 'size' bytes. |
| copier | A function that will perform the actual copy. The expected type of the function's arguments are controlled by the 'traits' template argument. The function will be passed 3 arguments:
- Traits::in_store_pointer: An address lying within the data store.
- Traits::temp_pointer: A pointer within the memory block given by [p,p+size).
- std::uint64_t: The number of bytes to be copied.
|