diff options
author | Tor Egge <Tor.Egge@yahooinc.com> | 2023-10-19 15:49:46 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahooinc.com> | 2023-10-19 15:49:46 +0200 |
commit | 55e4df8f4c7ba579b0c5bf257d977685e29e36b8 (patch) | |
tree | 54146c3304da30677ad091ec1549a78e7f6a408e /eval | |
parent | b35b2fff2b856e642a2e4562e4aea79a8f185065 (diff) |
mallinfo is linux specific.
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp b/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp index 1192f279496..051c5027999 100644 --- a/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp +++ b/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp @@ -10,8 +10,10 @@ #include <vespa/vespalib/util/guard.h> #include <vespa/vespalib/util/stringfmt.h> #include <charconv> +#ifdef __linux__ #include <malloc.h> #include <dlfcn.h> +#endif using vespalib::make_string_short::fmt; @@ -62,6 +64,7 @@ struct MemoryUsage { size_t malloc_current; }; +#ifdef __linux__ static const vespalib::string UNKNOWN = "unknown"; size_t convert(const vespalib::string & s) { @@ -111,6 +114,11 @@ MemoryUsage extract_memory_usage() { #endif return usage; } +#else +MemoryUsage extract_memory_usage() { + return { 0, 0, 0, 0 }; +} +#endif void report_memory_usage(const vespalib::string &desc) { MemoryUsage m = extract_memory_usage(); |