From d33fc70ecf45feddde1f7675730ff170c017d650 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Sat, 5 Dec 2015 02:09:22 +0000 Subject: [PATCH] [libFuzzer] don't reload the corpus more than once every second git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254824 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Fuzzer/FuzzerLoop.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Fuzzer/FuzzerLoop.cpp b/lib/Fuzzer/FuzzerLoop.cpp index ca7f82b5560..889c30c8748 100644 --- a/lib/Fuzzer/FuzzerLoop.cpp +++ b/lib/Fuzzer/FuzzerLoop.cpp @@ -468,10 +468,15 @@ void Fuzzer::Drill() { } void Fuzzer::Loop() { + system_clock::time_point LastCorpusReload = system_clock::now(); while (true) { size_t J1 = ChooseUnitIdxToMutate();; SyncCorpus(); - RereadOutputCorpus(); + auto Now = system_clock::now(); + if (duration_cast(Now - LastCorpusReload).count()) { + RereadOutputCorpus(); + LastCorpusReload = Now; + } if (TotalNumberOfRuns >= Options.MaxNumberOfRuns) break; if (Options.MaxTotalTimeSec > 0 && -- 2.34.1