diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-01-28 23:43:29 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-01-29 00:14:30 +0900 |
| commit | 8f51793b19c751bde0e41448aaeb9eb54d2fdbb1 (patch) | |
| tree | a4c085d881b499b87fba5932e80059b854229b09 /src/OptionHandlerFactory.cc | |
| parent | fc95a91eb617beb9130a6b1c7ed7c14a61189f8e (diff) | |
Add --max-mmap-limit option
Set the maximum file size to enable mmap (see --enable-mmap
option). The file size is determined by the sum of all files contained
in one download. For example, if a download contains 5 files, then
file size is the total size of those files. If file size is strictly
greater than the size specified in this option, mmap will be disabled.
Diffstat (limited to 'src/OptionHandlerFactory.cc')
| -rw-r--r-- | src/OptionHandlerFactory.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index ef6a8268..87b07cec 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -448,6 +448,16 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers() handlers.push_back(op); } { + OptionHandler* op(new UnitNumberOptionHandler( + PREF_MAX_MMAP_LIMIT, TEXT_MAX_MMAP_LIMIT, + util::itos(std::numeric_limits<int64_t>::max()), 0)); + op->addTag(TAG_ADVANCED); + op->setInitialOption(true); + op->setChangeGlobalOption(true); + op->setChangeOptionForReserved(true); + handlers.push_back(op); + } + { OptionHandler* op( new UnitNumberOptionHandler(PREF_MAX_OVERALL_DOWNLOAD_LIMIT, TEXT_MAX_OVERALL_DOWNLOAD_LIMIT, "0", 0)); |
