lightningbolt/lib/base/MmapFile.cpp

34 lines
631 B
C++
Raw Normal View History

// Copyright 2023 The LightningBolt Authors
// SPDX-License-Identifier: MIT
#include <base/MmapFile.hpp>
#ifdef __linux__
#include "MmapFile.linux.cpp"
#else
#error Invalid platform
#endif
namespace lightningbolt {
MmapFile::MmapFile() : impl(std::make_unique<Impl>()) {
}
MmapFile::~MmapFile() = default;
ErrorOr<void> MmapFile::Open(const fs::path& path) {
return impl->Open(path);
}
void MmapFile::Close() {
return impl->Close();
}
u8* MmapFile::GetMapping() const {
return impl->GetMapping();
}
usize MmapFile::GetMappingSize() const {
return impl->GetMappingSize();
}
} // namespace lightningbolt