MCPcopy Create free account
hub / github.com/Tencent/MMKV / msync

Method msync

Core/MemoryFile.cpp:224–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224bool MemoryFile::msync(SyncFlag syncFlag) {
225 if (m_readOnly) {
226 // there's no point in msync() readonly memory
227 return true;
228 }
229 if (m_ptr) {
230 auto ret = ::msync(m_ptr, m_size, syncFlag ? MS_SYNC : MS_ASYNC);
231 if (ret == 0) {
232 return true;
233 }
234 MMKVError("fail to msync [%s], %s", m_diskFile.m_path.c_str(), strerror(errno));
235 }
236 return false;
237}
238
239bool MemoryFile::mmapOrCleanup(FileLock *fileLock) {
240 auto oldPtr = m_ptr;

Callers 4

syncMethod · 0.45
clearAllMethod · 0.45
enableAutoKeyExpireMethod · 0.45
disableAutoKeyExpireMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected