// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. #pragma once #ifndef _WINDOWS #include #include #include #include #include #else #include #endif #include namespace diskann { class MemoryMapper { private: #ifndef _WINDOWS int _fd; #else HANDLE _bareFile; HANDLE _fd; #endif char *_buf; size_t _fileSize; const char *_fileName; public: MemoryMapper(const char *filename); MemoryMapper(const std::string &filename); char *getBuf(); size_t getFileSize(); ~MemoryMapper(); }; } // namespace diskann