summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-06-29 16:53:38 +0200
committerGitHub <noreply@github.com>2021-06-29 16:53:38 +0200
commit42167362fbeeed70c935c07a9020bba05a3f18f4 (patch)
tree97300efa49616c07dd5b4f678f9b26c2c951efa0 /searchcore
parent38566fbc618fd80a16515fef44989d6d41911a2b (diff)
Revert "Revert "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