aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-02-15 13:59:11 +0000
committerArne Juul <arnej@verizonmedia.com>2021-02-15 14:16:22 +0000
commit930cb9aa6409fda28bbeae268923b91e552f23fa (patch)
tree0cae7825cc25232d05436ad5a9f6b5faa56e1c47
parent5c163650a15ac1bc39657a28bbdc9dd57051cc62 (diff)
use size literals in config
-rw-r--r--config/src/tests/configfetcher/configfetcher.cpp2
-rw-r--r--config/src/tests/misc/configsystem.cpp3
-rw-r--r--config/src/vespa/config/file_acquirer/file_acquirer.cpp3
-rw-r--r--config/src/vespa/config/frt/frtconnectionpool.cpp3
-rw-r--r--configd/src/apps/sentinel/config-handler.cpp5
-rw-r--r--configd/src/apps/sentinel/line-splitter.cpp3
6 files changed, 12 insertions, 7 deletions
diff --git a/config/src/tests/configfetcher/configfetcher.cpp b/config/src/tests/configfetcher/configfetcher.cpp
index 0cff6208873..3ac2a232f93 100644
--- a/config/src/tests/configfetcher/configfetcher.cpp
+++ b/config/src/tests/configfetcher/configfetcher.cpp
@@ -51,7 +51,7 @@ TEST("requireThatConfigUpdatesArePerformed") {
FileSpec spec("test1.cfg");
MyCallback cb;
cb._configured = false;
- vespalib::ThreadStackExecutor executor(1, 128 * 1024);
+ vespalib::ThreadStackExecutor executor(1, 128_Ki);
{
ConfigFetcher fetcher(500);
diff --git a/config/src/tests/misc/configsystem.cpp b/config/src/tests/misc/configsystem.cpp
index 9574d9d274a..b8748cdbc5b 100644
--- a/config/src/tests/misc/configsystem.cpp
+++ b/config/src/tests/misc/configsystem.cpp
@@ -1,5 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/config/common/configsystem.h>
#include <vespa/defaults.h>
#include <vespa/fastos/file.h>
@@ -10,7 +11,7 @@ using namespace config;
namespace {
const char *VESPA_HOME="VESPA_HOME";
-char cwd[1024];
+char cwd[1_Ki];
}
diff --git a/config/src/vespa/config/file_acquirer/file_acquirer.cpp b/config/src/vespa/config/file_acquirer/file_acquirer.cpp
index a61f480b33f..1235a345198 100644
--- a/config/src/vespa/config/file_acquirer/file_acquirer.cpp
+++ b/config/src/vespa/config/file_acquirer/file_acquirer.cpp
@@ -5,6 +5,7 @@
#include <vespa/fnet/frt/target.h>
#include <vespa/fnet/frt/rpcrequest.h>
#include <vespa/fnet/transport.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/fastos/thread.h>
#include <vespa/log/log.h>
@@ -13,7 +14,7 @@ LOG_SETUP(".config.file_acquirer");
namespace config {
RpcFileAcquirer::RpcFileAcquirer(const vespalib::string &spec)
- : _threadPool(std::make_unique<FastOS_ThreadPool>(1024*60)),
+ : _threadPool(std::make_unique<FastOS_ThreadPool>(60_Ki)),
_transport(std::make_unique<FNET_Transport>()),
_orb(std::make_unique<FRT_Supervisor>(_transport.get())),
_spec(spec)
diff --git a/config/src/vespa/config/frt/frtconnectionpool.cpp b/config/src/vespa/config/frt/frtconnectionpool.cpp
index 5dccf033ab7..1aff50f9041 100644
--- a/config/src/vespa/config/frt/frtconnectionpool.cpp
+++ b/config/src/vespa/config/frt/frtconnectionpool.cpp
@@ -2,6 +2,7 @@
#include "frtconnectionpool.h"
#include <vespa/vespalib/util/host_name.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/fnet/transport.h>
#include <vespa/fastos/thread.h>
@@ -27,7 +28,7 @@ FRTConnectionPool::FRTConnectionKey::operator==(const FRTConnectionKey& right) c
}
FRTConnectionPool::FRTConnectionPool(const ServerSpec & spec, const TimingValues & timingValues)
- : _threadPool(std::make_unique<FastOS_ThreadPool>(1024*60)),
+ : _threadPool(std::make_unique<FastOS_ThreadPool>(60_Ki)),
_transport(std::make_unique<FNET_Transport>()),
_supervisor(std::make_unique<FRT_Supervisor>(_transport.get())),
_selectIdx(0),
diff --git a/configd/src/apps/sentinel/config-handler.cpp b/configd/src/apps/sentinel/config-handler.cpp
index 15560daf435..9c39b13ba4c 100644
--- a/configd/src/apps/sentinel/config-handler.cpp
+++ b/configd/src/apps/sentinel/config-handler.cpp
@@ -5,6 +5,7 @@
#include <vespa/vespalib/net/socket_address.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <string>
#include <fcntl.h>
#include <sys/wait.h>
@@ -284,8 +285,8 @@ ConfigHandler::handleCmd(const Cmd& cmd)
switch (cmd.type()) {
case Cmd::LIST:
{
- char retbuf[65536];
- size_t left = 65536;
+ char retbuf[64_Ki];
+ size_t left = 64_Ki;
size_t pos = 0;
retbuf[pos] = 0;
for (const auto & entry : _services) {
diff --git a/configd/src/apps/sentinel/line-splitter.cpp b/configd/src/apps/sentinel/line-splitter.cpp
index 9bfac17225e..a7725f1ae67 100644
--- a/configd/src/apps/sentinel/line-splitter.cpp
+++ b/configd/src/apps/sentinel/line-splitter.cpp
@@ -11,6 +11,7 @@
#include <unistd.h>
+#include <vespa/vespalib/util/size_literals.h>
#include "line-splitter.h"
namespace config {
@@ -19,7 +20,7 @@ namespace sentinel {
LineSplitter::LineSplitter(int fd)
: _fd(fd),
- _size(8192),
+ _size(8_Ki),
_buffer(static_cast<char *>(malloc(_size))),
_readPos(0),
_writePos(0),