summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-06-29 10:24:05 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-06-29 10:26:18 +0000
commit549c64cd86d4bbb909f7fbbcd741d274716ca4d8 (patch)
tree075fa1f1402f18330e1abd52f262639718ed7bb0 /searchcore
parent373c416eac655e576d1b227b9ec83b404c692d43 (diff)
Add support for mallinfo2 with glibc 2.33
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 9c5438825b2..adae323c1d9 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -767,15 +767,15 @@ Proton::updateMetrics(const metrics::MetricLockGuard &)
metrics.resourceUsage.openFileDescriptors.set(FastOS_File::count_open_files());
metrics.resourceUsage.feedingBlocked.set((usageFilter.acceptWriteOperation() ? 0.0 : 1.0));
#ifdef __linux__
-#pragma GCC diagnostic push
#if __GLIBC_PREREQ(2, 33)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
+ struct mallinfo2 mallocInfo = mallinfo2();
+ metrics.resourceUsage.mallocArena.set(mallocInfo.arena);
+#else
struct mallinfo mallocInfo = mallinfo();
-#pragma GCC diagnostic pop
// Vespamalloc reports arena in 1M blocks as an 'int' is too small.
// If we use something else than vespamalloc this must be changed.
metrics.resourceUsage.mallocArena.set(uint64_t(mallocInfo.arena) * 1_Mi);
+#endif
#else
metrics.resourceUsage.mallocArena.set(UINT64_C(0));
#endif