diff options
Diffstat (limited to 'src/StreamFileAllocationEntry.cc')
| -rw-r--r-- | src/StreamFileAllocationEntry.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc index dd440a35..b93df899 100644 --- a/src/StreamFileAllocationEntry.cc +++ b/src/StreamFileAllocationEntry.cc @@ -44,6 +44,8 @@ #include "Command.h" #include "PeerStat.h" #include "FileEntry.h" +#include "PieceStorage.h" +#include "DiskAdaptor.h" namespace aria2 { @@ -61,6 +63,9 @@ void StreamFileAllocationEntry::prepareForNextAction // For DownloadContext::resetDownloadStartTime(), see also // RequestGroup::createInitialCommand() getRequestGroup()->getDownloadContext()->resetDownloadStartTime(); + if(getRequestGroup()->getOption()->getAsBool(PREF_ENABLE_MMAP)) { + getRequestGroup()->getPieceStorage()->getDiskAdaptor()->enableMmap(); + } if(getNextCommand()) { // Reset download start time of PeerStat because it is started // before file allocation begins. |
