We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49c45b1 commit 31fc41aCopy full SHA for 31fc41a
test/common/memory_usage.h
@@ -74,7 +74,8 @@ namespace utils {
74
peakUsage
75
};
76
77
-#if __unix__
+#if __linux__
78
+
79
inline unsigned LinuxKernelVersion()
80
{
81
unsigned digit1, digit2, digit3;
@@ -125,8 +126,11 @@ namespace utils {
125
126
break;
127
}
128
- // VmPeak is available in kernels staring 2.6.15
129
- if (stat != peakUsage || LinuxKernelVersion() >= 2006015)
+ // VmPeak is available in Linux kernels staring 2.6.15
130
+ if (stat != peakUsage
131
132
+ || LinuxKernelVersion() >= 2006015)
133
+#endif
134
ASSERT(size, "Invalid /proc/self/status format, pattern not found.");
135
fclose(fst);
136
return size * 1024;
0 commit comments