From af7179f8cc81ef51e96a74971c3ab40d5f3a0a8e Mon Sep 17 00:00:00 2001 From: Kirill Ponomarev Date: Sun, 25 Apr 2021 08:47:43 +0200 Subject: databases/clickhouse: update to 21.3.6.55-lts PR: 255352 Reported by: maintainer --- .../files/patch-src_Common_MemoryStatisticsOS.cpp | 38 ++++++++++------------ 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp') diff --git a/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp b/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp index a4e9ad63dbcc..de0458181f69 100644 --- a/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp +++ b/databases/clickhouse/files/patch-src_Common_MemoryStatisticsOS.cpp @@ -1,6 +1,6 @@ ---- src/Common/MemoryStatisticsOS.cpp.orig 2020-08-31 16:22:57 UTC +--- src/Common/MemoryStatisticsOS.cpp.orig 2021-03-19 11:39:14 UTC +++ src/Common/MemoryStatisticsOS.cpp -@@ -1,7 +1,13 @@ +@@ -1,14 +1,20 @@ -#if defined(OS_LINUX) - #include @@ -16,19 +16,15 @@ #include #include #include -@@ -11,9 +17,10 @@ - #include - #include - #include --#include + #include "MemoryStatisticsOS.h" -+ -+ - namespace DB - { - -@@ -23,21 +30,40 @@ namespace ErrorCodes +-#include ++//#include + #include + #include + #include +@@ -24,20 +30,40 @@ namespace ErrorCodes extern const int CANNOT_OPEN_FILE; extern const int CANNOT_READ_FROM_FILE_DESCRIPTOR; extern const int CANNOT_CLOSE_FILE; @@ -37,9 +33,10 @@ +#endif } +-static constexpr auto filename = "/proc/self/statm"; +#ifndef OS_FREEBSD - static constexpr auto filename = "/proc/self/statm"; - static constexpr size_t PAGE_SIZE = 4096; ++ static constexpr auto filename = "/proc/self/statm"; ++ static constexpr size_t PAGE_SIZE = 4096; +#endif MemoryStatisticsOS::MemoryStatisticsOS() @@ -69,7 +66,7 @@ if (0 != ::close(fd)) { try -@@ -51,12 +77,43 @@ MemoryStatisticsOS::~MemoryStatisticsOS() +@@ -51,12 +77,42 @@ MemoryStatisticsOS::~MemoryStatisticsOS() DB::tryLogCurrentException(__PRETTY_FUNCTION__); } } @@ -109,14 +106,13 @@ + ::procstat_freevmmap(pstat, kve); + ::procstat_freeprocs(pstat, kp); +#else -+ constexpr size_t buf_size = 1024; char buf[buf_size]; -@@ -98,10 +155,8 @@ MemoryStatisticsOS::Data MemoryStatisticsOS::get() con - data.shared *= PAGE_SIZE; - data.code *= PAGE_SIZE; - data.data_and_stack *= PAGE_SIZE; +@@ -99,10 +155,8 @@ MemoryStatisticsOS::Data MemoryStatisticsOS::get() con + data.shared *= page_size; + data.code *= page_size; + data.data_and_stack *= page_size; - +#endif return data; -- cgit v1.2.3