diff --git a/src/OSD/OSD_MemInfo.cxx b/src/OSD/OSD_MemInfo.cxx index 08a939bebf..d9bb913986 100644 --- a/src/OSD/OSD_MemInfo.cxx +++ b/src/OSD/OSD_MemInfo.cxx @@ -182,7 +182,17 @@ void OSD_MemInfo::Update() #elif (defined(__linux__) || defined(__linux)) if (IsActive (MemHeapUsage)) { + #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2,33) + #define HAS_MALLINFO2 + #endif + #endif + + #ifdef HAS_MALLINFO2 + const struct mallinfo2 aMI = mallinfo2(); + #else const struct mallinfo aMI = mallinfo(); + #endif myCounters[MemHeapUsage] = aMI.uordblks; }