Skip to content

Commit 8aac46d

Browse files
committed
[RocksDB Performance Branch] Fix a regression bug of munmap
Summary: Fix a stupid bug I just introduced in b59d4d5, which I didn't even mean to include. GCC might remove the munmap. Test Plan: Run it and make sure munmap succeeds Reviewers: haobo, kailiu Reviewed By: kailiu CC: dhruba, reconnect.grayhat, leveldb Differential Revision: https://reviews.facebook.net/D14361
1 parent dfa1460 commit 8aac46d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

util/env_posix.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,11 @@ class PosixMmapReadableFile: public RandomAccessFile {
307307
assert(options.use_os_buffer);
308308
}
309309
virtual ~PosixMmapReadableFile() {
310-
assert(munmap(mmapped_region_, length_) == 0);
310+
int ret = munmap(mmapped_region_, length_);
311+
if (ret != 0) {
312+
fprintf(stdout, "failed to munmap %p length %zu \n",
313+
mmapped_region_, length_);
314+
}
311315
}
312316

313317
virtual Status Read(uint64_t offset, size_t n, Slice* result,

0 commit comments

Comments
 (0)