LLVM 22.0.0git
|
This class represents a memory mapped file. More...
#include "llvm/Support/FileSystem.h"
Public Types | |
enum | mapmode { readonly , readwrite , priv } |
Public Member Functions | |
mapped_file_region ()=default | |
mapped_file_region (mapped_file_region &&Moved) | |
mapped_file_region & | operator= (mapped_file_region &&Moved) |
mapped_file_region (const mapped_file_region &)=delete | |
mapped_file_region & | operator= (const mapped_file_region &)=delete |
LLVM_ABI | mapped_file_region (sys::fs::file_t fd, mapmode mode, size_t length, uint64_t offset, std::error_code &ec) |
~mapped_file_region () | |
operator bool () const | |
Check if this is a valid mapping. | |
void | unmap () |
Unmap. | |
void | dontNeed () |
LLVM_ABI size_t | size () const |
LLVM_ABI char * | data () const |
LLVM_ABI std::error_code | sync () const |
Write changes to disk and synchronize. | |
LLVM_ABI const char * | const_data () const |
Get a const view of the data. |
Static Public Member Functions | |
static LLVM_ABI int | alignment () |
This class represents a memory mapped file.
It is based on boost::iostreams::mapped_file.
Definition at line 1292 of file FileSystem.h.
Enumerator | |
---|---|
readonly | May only access map via const_data as read only. |
readwrite | May access map via data and modify it. Written to path. |
priv | May modify via data, but changes are lost on destruction. |
Definition at line 1294 of file FileSystem.h.
|
default |
Referenced by mapped_file_region(), mapped_file_region(), operator=(), operator=(), and unmap().
|
inline |
Definition at line 1331 of file FileSystem.h.
References mapped_file_region().
|
delete |
References mapped_file_region().
LLVM_ABI llvm::sys::fs::mapped_file_region::mapped_file_region | ( | sys::fs::file_t | fd, |
mapmode | mode, | ||
size_t | length, | ||
uint64_t | offset, | ||
std::error_code & | ec ) |
|
inline |
Definition at line 1345 of file FileSystem.h.
|
static |
References LLVM_ABI.
Get a const view of the data.
Modifying this memory has undefined behavior.
Definition at line 1169 of file Path.cpp.
References assert().
Referenced by areFilesDifferent().
char * llvm::sys::fs::mapped_file_region::data | ( | ) | const |
Definition at line 1164 of file Path.cpp.
References assert().
Referenced by llvm::cas::ondisk::DatabaseFile::addTable(), llvm::xray::loadProfile(), llvm::xray::loadTraceFile(), and loadYAML().
|
inline |
Definition at line 1355 of file FileSystem.h.
|
inlineexplicit |
Check if this is a valid mapping.
Definition at line 1348 of file FileSystem.h.
|
delete |
References mapped_file_region().
|
inline |
Definition at line 1332 of file FileSystem.h.
References mapped_file_region(), and unmap().
size_t llvm::sys::fs::mapped_file_region::size | ( | ) | const |
Definition at line 1159 of file Path.cpp.
References assert().
Referenced by llvm::xray::loadProfile(), llvm::xray::loadTraceFile(), and loadYAML().
LLVM_ABI std::error_code llvm::sys::fs::mapped_file_region::sync | ( | ) | const |
Write changes to disk and synchronize.
Equivalent to POSIX msync. This will wait for flushing memory-mapped region back to disk and can be very slow.
References LLVM_ABI.
|
inline |
Unmap.
Definition at line 1351 of file FileSystem.h.
References mapped_file_region().
Referenced by operator=().