Use cached filesize instead of calling size() again

This commit is contained in:
Tatsuhiro Tsujikawa 2015-11-14 00:09:40 +09:00
parent 3974c1223b
commit dfadc2e68b

View File

@ -380,7 +380,7 @@ void AbstractDiskWriter::ensureMmapWrite(size_t len, int64_t offset)
}
#else // !__MINGW32__
mapaddr_ = reinterpret_cast<unsigned char*>
(mmap(nullptr, size(), PROT_READ | PROT_WRITE, MAP_SHARED, fd_, 0));
(mmap(nullptr, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, 0));
if(!mapaddr_) {
errNum = errno;
}