Index: llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp =================================================================== --- llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp +++ llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp @@ -288,7 +288,15 @@ struct rusage usage; if (getrusage(RUSAGE_SELF, &usage)) return 0; - return usage.ru_maxrss >> 10; + if (LIBFUZZER_LINUX) { + // ru_maxrss is in KiB + return usage.ru_maxrss >> 10; + } else if (LIBFUZZER_APPLE) { + // ru_maxrss is in bytes + return usage.ru_maxrss >> 20; + } + assert(0 && "GetPeakRSSMb() is not implemented for your platform"); + return 0; } } // namespace fuzzer