aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Unix/Program.inc
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r--llvm/lib/Support/Unix/Program.inc7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index d42681f..679ba53 100644
--- a/llvm/lib/Support/Unix/Program.inc
+++ b/llvm/lib/Support/Unix/Program.inc
@@ -452,12 +452,11 @@ ProcessInfo llvm::sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
if (ProcStat) {
std::chrono::microseconds UserT = toDuration(Info.ru_utime);
std::chrono::microseconds KernelT = toDuration(Info.ru_stime);
+ uint64_t PeakMemory = 0;
#ifndef __HAIKU__
- uint64_t PeakMemory = static_cast<uint64_t>(Info.ru_maxrss);
- *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory};
-#else
- *ProcStat = ProcessStatistics{UserT + KernelT, UserT, 0};
+ PeakMemory = static_cast<uint64_t>(Info.ru_maxrss);
#endif
+ *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory};
}
// Return the proper exit status. Detect error conditions