| 103 | } |
| 104 | |
| 105 | MemoryFile::MemoryFile(MMKVPath_t path, size_t expectedCapacity, bool readOnly, bool mayflyFD) |
| 106 | : m_diskFile(std::move(path), readOnly ? OpenFlag::ReadOnly : (OpenFlag::ReadWrite | OpenFlag::Create)) |
| 107 | , m_fileMapping(nullptr) |
| 108 | , m_ptr(nullptr) |
| 109 | , m_size(0) |
| 110 | , m_readOnly(readOnly) |
| 111 | , m_isMayflyFD(mayflyFD) { |
| 112 | reloadFromFile(expectedCapacity); |
| 113 | } |
| 114 | |
| 115 | bool MemoryFile::truncate(size_t size, FileLock *fileLock) { |
| 116 | if (m_isMayflyFD) { |
nothing calls this directly
no outgoing calls
no test coverage detected