| 111 | } |
| 112 | |
| 113 | void BinaryBlob::reset() noexcept { |
| 114 | #if defined(__unix__) || defined(__APPLE__) |
| 115 | if (mapped_ != nullptr) { |
| 116 | munmap(const_cast<std::byte *>(mapped_), size_); |
| 117 | mapped_ = nullptr; |
| 118 | size_ = 0; |
| 119 | } |
| 120 | #else |
| 121 | mapped_ = nullptr; |
| 122 | size_ = 0; |
| 123 | #endif |
| 124 | owned_.clear(); |
| 125 | owned_.shrink_to_fit(); |
| 126 | } |
| 127 | |
| 128 | BinaryBlob read_binary_blob(const std::filesystem::path & path) { |
| 129 | #if defined(__unix__) || defined(__APPLE__) |
no test coverage detected