revert cgroup memory limit to uint64_t

... to fix compiler warning about signed/unsigned comparison.

See issue #25662
This commit is contained in:
Pavel Medvedev 2021-11-08 18:56:31 +01:00
parent 54f543b61a
commit 340aed30b6

View File

@ -31,7 +31,7 @@ uint64_t getMemoryAmountOrZero()
std::ifstream cgroup_limit("/sys/fs/cgroup/memory/memory.limit_in_bytes");
if (cgroup_limit.is_open())
{
int64_t memory_limit = 0; // in case of read error
uint64_t memory_limit = 0; // in case of read error
cgroup_limit >> memory_limit;
if (memory_limit > 0 && memory_limit < memory_amount)
memory_amount = memory_limit;