Map a subrange of the specified file as a MemoryBuffer.
Declared in <llvm/Support/MemoryBuffer.h>
static
ErrorOr<std::unique_ptr<MemoryBuffer>>
getFileSlice(
Twine const& Filename,
uint64_t MapSize,
uint64_t Offset,
bool IsVolatile = false,
std::optional<Align> Alignment = std::nullopt);
The mapped buffer on success, or an error on failure.
| Name | Description |
|---|---|
| Filename | Path of the file to map. |
| MapSize | Number of bytes to map from the file. |
| Offset | Byte offset into the file at which to begin the mapping. |
| IsVolatile | Set to true to indicate that the contents of the file can change outside the user's control. |
| Alignment | Set to indicate that the buffer should be aligned to at least the specified alignment. |