8000 Converted int literals to size_t (#21840) · arangodb/arangodb@839bb14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 839bb14

Browse files
authored
Converted int literals to size_t (#21840)
1 parent dcb4440 commit 839bb14

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

arangod/RestServer/ApiRecordingFeature.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ void ApiRecordingFeature::collectOptions(
7272
options->addOption(
7373
"--server.api-recording-memory-limit",
7474
"Size limit for the list of API call records.",
75-
new UInt64Parameter(&_totalMemoryLimitCalls, 1, 256 * 1024,
76-
256 * 1024 * 1024 * 1024),
75+
new UInt64Parameter(&_totalMemoryLimitCalls, 1,
76+
256 * (std::size_t{1} << 10), // Min: 256 KiB
77+
256 * (std::size_t{1} << 30) // Max: 256 GiB
78+
),
7779
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Uncommon));
7880

7981
options->addOption(
@@ -85,8 +87,10 @@ void ApiRecordingFeature::collectOptions(
8587
options->addOption(
8688
"--server.aql-recording-memory-limit",
8789
"Size limit for the list of AQL query records.",
88-
new UInt64Parameter(&_totalMemoryLimitQueries, 1, 256 * 1024,
89-
256 * 1024 * 1024 * 1024),
90+
new UInt64Parameter(&_totalMemoryLimitQueries, 1,
91+
256 * (std::size_t{1} << 10), // Min: 256 KiB
92+
256 * (std::size_t{1} << 30) // Max: 256 GiB
93+
),
9094
arangodb::options::makeDefaultFlags(arangodb::options::Flags::Uncommon));
9195

9296
options

arangod/RestServer/ApiRecordingFeature.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ class ApiRecordingFeature : public ArangodFeature {
159159
bool _enabledQueries{true};
160160

161161
// Total memory limit for all ApiCallRecord lists combined
162-
size_t _totalMemoryLimitCalls{25 * 1024 * 1024}; // Default: ~25MiB
162+
size_t _totalMemoryLimitCalls{25 * (std::size_t{1} << 20)}; // Default: 25MiB
163163

164164
// Total memory limit for all AqlCallRecord lists combined
165-
size_t _totalMemoryLimitQueries{25 * 1024 * 1024}; // Default: ~25MiB
165+
size_t _totalMemoryLimitQueries{25 *
166+
(std::size_t{1} << 20)}; // Default: 25MiB
166167

167168
// Memory limit for one list of ApiCallRecords (calculated as
168169
// _totalMemoryLimitCalls / NUMBER_OF_API_RECORD_LISTS)

0 commit comments

Comments
 (0)
0