aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-07-27 14:39:21 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-07-27 14:39:21 +0000
commit1b21aebee4e4158a398a6fbf9bcf61f77ac6df21 (patch)
treefdbfb2a8ed35fa0f9649f868d5a35b4908880e4d /vespalib/src
parent018bcfcb2640fd7758d8a4f21510fd1f8a508f35 (diff)
- Return double for computation.
- Do not hide narrowing to 32 bit. - Use enum class.
Diffstat (limited to 'vespalib/src')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/compaction_strategy.h6
-rw-r--r--vespalib/src/vespa/vespalib/util/growstrategy.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h b/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h
index c0c1857deae..dd41ed244ae 100644
--- a/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h
+++ b/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h
@@ -56,10 +56,10 @@ public:
_active_buffers_ratio(active_buffers_ratio),
_max_buffers(max_buffers)
{ }
- float getMaxDeadBytesRatio() const noexcept { return _maxDeadBytesRatio; }
- float getMaxDeadAddressSpaceRatio() const noexcept { return _maxDeadAddressSpaceRatio; }
+ double getMaxDeadBytesRatio() const noexcept { return _maxDeadBytesRatio; }
+ double getMaxDeadAddressSpaceRatio() const noexcept { return _maxDeadAddressSpaceRatio; }
uint32_t get_max_buffers() const noexcept { return _max_buffers; }
- float get_active_buffers_ratio() const noexcept { return _active_buffers_ratio; }
+ double get_active_buffers_ratio() const noexcept { return _active_buffers_ratio; }
bool operator==(const CompactionStrategy & rhs) const noexcept {
return (_maxDeadBytesRatio == rhs._maxDeadBytesRatio) &&
(_maxDeadAddressSpaceRatio == rhs._maxDeadAddressSpaceRatio) &&
diff --git a/vespalib/src/vespa/vespalib/util/growstrategy.h b/vespalib/src/vespa/vespalib/util/growstrategy.h
index 643e3f03023..900c87c6cdf 100644
--- a/vespalib/src/vespa/vespalib/util/growstrategy.h
+++ b/vespalib/src/vespa/vespalib/util/growstrategy.h
@@ -18,7 +18,7 @@ public:
GrowStrategy() noexcept
: GrowStrategy(1024, 0.5, 0, 0)
{}
- GrowStrategy(size_t initialCapacity, float growPercent, size_t growDelta, size_t minimumCapacity) noexcept
+ GrowStrategy(uint32_t initialCapacity, float growPercent, uint32_t growDelta, uint32_t minimumCapacity) noexcept
: _initialCapacity(initialCapacity),
_minimumCapacity(minimumCapacity),
_growDelta(growDelta),