mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
[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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user