| 134 | } |
| 135 | |
| 136 | void MappedFile::Close() |
| 137 | { |
| 138 | #ifdef OMIM_OS_WINDOWS |
| 139 | if (m_hMapping != INVALID_HANDLE_VALUE) |
| 140 | { |
| 141 | CloseHandle(m_hMapping); |
| 142 | m_hMapping = INVALID_HANDLE_VALUE; |
| 143 | } |
| 144 | if (m_hFile != INVALID_HANDLE_VALUE) |
| 145 | { |
| 146 | CloseHandle(m_hFile); |
| 147 | m_hFile = INVALID_HANDLE_VALUE; |
| 148 | } |
| 149 | #else |
| 150 | if (m_fd != -1) |
| 151 | { |
| 152 | close(m_fd); |
| 153 | m_fd = -1; |
| 154 | } |
| 155 | #endif |
| 156 | } |
| 157 | |
| 158 | MappedFile::Handle MappedFile::Map(uint64_t offset, uint64_t size, std::string const & tag) const |
| 159 | { |