From 8f51793b19c751bde0e41448aaeb9eb54d2fdbb1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 28 Jan 2016 23:43:29 +0900 Subject: 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. --- src/OptionHandlerFactory.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/OptionHandlerFactory.cc') diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index ef6a8268..87b07cec 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -447,6 +447,16 @@ std::vector OptionHandlerFactory::createOptionHandlers() op->setChangeGlobalOption(true); handlers.push_back(op); } + { + OptionHandler* op(new UnitNumberOptionHandler( + PREF_MAX_MMAP_LIMIT, TEXT_MAX_MMAP_LIMIT, + util::itos(std::numeric_limits::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, -- cgit