#include <rex/memory/virtual_memory.h>
|
| virtual u8 * | Allocate (size_t length)=0 |
|
virtual void | Flush ()=0 |
| virtual void | FlushNew ()=0 |
|
|
std::filesystem::path | path_ |
|
size_t | chunk_size_ |
|
bool | low_address_space_ |
Append only writer over fixed size mapped files named path.N.
◆ ChunkedMappedMemoryWriter()
| rex::memory::ChunkedMappedMemoryWriter::ChunkedMappedMemoryWriter |
( |
const std::filesystem::path & | path, |
|
|
size_t | chunk_size, |
|
|
bool | low_address_space ) |
|
inlineprotected |
Stores the writer settings.
- Parameters
-
| low_address_space | True to map chunks below 4 GiB. |
◆ Allocate()
| virtual u8 * rex::memory::ChunkedMappedMemoryWriter::Allocate |
( |
size_t | length | ) |
|
|
pure virtual |
Reserves space in the current chunk, opening a new chunk when it is full.
- Parameters
-
| length | Byte count, no larger than the chunk size. |
- Returns
- Pointer to the reserved space, or null on failure.
◆ FlushNew()
| virtual void rex::memory::ChunkedMappedMemoryWriter::FlushNew |
( |
| ) |
|
|
pure virtual |
Writes the data added since the last FlushNew back to the files.
◆ Open()
| std::unique_ptr< ChunkedMappedMemoryWriter > rex::memory::ChunkedMappedMemoryWriter::Open |
( |
const std::filesystem::path & | path, |
|
|
size_t | chunk_size, |
|
|
bool | low_address_space = false ) |
|
static |
Creates a writer.
- Parameters
-
| chunk_size | Byte size of each chunk, rounded up to the allocation granularity. |
| low_address_space | True to map chunks below 4 GiB, which Allocate refuses on macOS. |
The documentation for this class was generated from the following file: