diff options
author | Tor Egge <Tor.Egge@verizonmedia.com> | 2021-06-29 11:47:08 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@verizonmedia.com> | 2021-06-29 11:47:08 +0200 |
commit | da9189d3570e2f784a004b08ad7b5762b7ee0134 (patch) | |
tree | 7cc91baf28c54196def67b076f066a2b3c6caa1a /searchcore | |
parent | 994334656a7ed10ec7a53d421f0841f67c65b312 (diff) |
mallinfo() is only available on linux systems.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 7ab6b70cd6d..9c5438825b2 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -40,7 +40,9 @@ #include <vespa/vespalib/util/mmap_file_allocator_factory.h> #include <vespa/vespalib/util/random.h> #include <vespa/vespalib/util/size_literals.h> +#ifdef __linux__ #include <malloc.h> +#endif #include <vespa/searchlib/aggregation/forcelink.hpp> #include <vespa/searchlib/expression/forcelink.hpp> @@ -764,6 +766,7 @@ Proton::updateMetrics(const metrics::MetricLockGuard &) metrics.resourceUsage.memoryMappings.set(usageFilter.getMemoryStats().getMappingsCount()); 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" @@ -773,6 +776,9 @@ Proton::updateMetrics(const metrics::MetricLockGuard &) // 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); +#else + metrics.resourceUsage.mallocArena.set(UINT64_C(0)); +#endif } { ContentProtonMetrics::ProtonExecutorMetrics &metrics = _metricsEngine->root().executor; |