diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-09-18 03:59:48 -0700 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-09-18 03:59:48 -0700 |
commit | 17dc219ade1c241f7e40d5e0942d291219439792 (patch) | |
tree | 2bf12f1cf62479a76a682f972b6de91fc8e2dc84 /searchlib | |
parent | d382242496bc164c2eddd9e5d0d00c107a90eb9c (diff) | |
parent | 59f42ff1e807e60361d13663e4039038cd239120 (diff) |
Merge with master
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/common/tunefileinfo.h | 5 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/common/tunefileinfo.hpp | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.h b/searchlib/src/vespa/searchlib/common/tunefileinfo.h index 223dcdbc7f1..edd6d29dd58 100644 --- a/searchlib/src/vespa/searchlib/common/tunefileinfo.h +++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.h @@ -119,8 +119,9 @@ public: int getAdvise() const { return _advise; } template <typename TuneControlConfig, typename MMapConfig> - void - setFromConfig(const enum TuneControlConfig::Io & tuneControlConfig, const MMapConfig & mmapFlags); + void setFromConfig(const enum TuneControlConfig::Io & tuneControlConfig, const MMapConfig & mmapFlags); + template <typename MMapConfig> + void setFromMmapConfig(const MMapConfig & mmapFlags); bool operator==(const TuneFileRandRead &rhs) const { return (_tuneControl == rhs._tuneControl) && (_mmapFlags == rhs._mmapFlags); diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp b/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp index 22d89d904d2..08acd2caa97 100644 --- a/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp +++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp @@ -1,3 +1,4 @@ + // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once @@ -17,6 +18,12 @@ TuneFileRandRead::setFromConfig(const enum TuneControlConfig::Io & tuneControlCo case TuneControlConfig::MMAP: _tuneControl = MMAP; break; default: _tuneControl = NORMAL; break; } + setFromMmapConfig(mmapFlags); +} + +template <typename MMapConfig> +void +TuneFileRandRead::setFromMmapConfig(const MMapConfig & mmapFlags) { for (size_t i(0), m(mmapFlags.options.size()); i < m; i++) { switch (mmapFlags.options[i]) { case MMapConfig::MLOCK: _mmapFlags |= MAP_LOCKED; break; |