mirror of
https://github.com/aria2/aria2.git
synced 2025-01-24 02:31:29 +00:00
Use cached filesize instead of calling size() again
This commit is contained in:
parent
3974c1223b
commit
dfadc2e68b
@ -380,7 +380,7 @@ void AbstractDiskWriter::ensureMmapWrite(size_t len, int64_t offset)
|
|||||||
}
|
}
|
||||||
#else // !__MINGW32__
|
#else // !__MINGW32__
|
||||||
mapaddr_ = reinterpret_cast<unsigned char*>
|
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_) {
|
if(!mapaddr_) {
|
||||||
errNum = errno;
|
errNum = errno;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user