mirror of
https://github.com/Tencent/MMKV.git
synced 2026-10-17 04:30:56 +08:00
log mmap() result address
This commit is contained in:
+2
-1
@@ -192,13 +192,14 @@ bool MemoryFile::msync(SyncFlag syncFlag) {
|
||||
}
|
||||
|
||||
bool MemoryFile::mmap() {
|
||||
auto oldPtr = m_ptr;
|
||||
m_ptr = (char *) ::mmap(m_ptr, m_size, PROT_READ | PROT_WRITE, MAP_SHARED, m_diskFile.m_fd, 0);
|
||||
if (m_ptr == MAP_FAILED) {
|
||||
MMKVError("fail to mmap [%s], %s", m_diskFile.m_path.c_str(), strerror(errno));
|
||||
m_ptr = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
MMKVInfo("mmap to address [%p], oldPtr [%p], [%s]", m_ptr, oldPtr, m_diskFile.m_path.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user