[RocksDB Performance Branch] Fix a regression bug of munmap

Summary:
Fix a stupid bug I just introduced in b59d4d5a50, 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
main
Siying Dong 11 years ago
parent dfa1460d88
commit 8aac46d686
  1. 6
      util/env_posix.cc

@ -307,7 +307,11 @@ class PosixMmapReadableFile: public RandomAccessFile {
assert(options.use_os_buffer);
}
virtual ~PosixMmapReadableFile() {
assert(munmap(mmapped_region_, length_) == 0);
int ret = munmap(mmapped_region_, length_);
if (ret != 0) {
fprintf(stdout, "failed to munmap %p length %zu \n",
mmapped_region_, length_);
}
}
virtual Status Read(uint64_t offset, size_t n, Slice* result,

Loading…
Cancel
Save