Skip to content

Commit

Permalink
[feat] Enable coverOnTheFly after approaching memory cup
Browse files Browse the repository at this point in the history
  • Loading branch information
misonijnik committed Nov 2, 2023
1 parent 7c002e7 commit bf98cd2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Core/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4082,6 +4082,15 @@ bool Executor::checkMemoryUsage() {
const auto mallocUsage = util::GetTotalMallocUsage() >> 20U;
const auto mmapUsage = memory->getUsedDeterministicSize() >> 20U;
const auto totalUsage = mallocUsage + mmapUsage;

if (guidanceKind == GuidanceKind::CoverageGuidance &&
3 * totalUsage <= 2 * MaxMemory) {
klee_warning_once(0,
"enabling cover-on-the-fly (close to memory cap: %luMB)",
totalUsage);
coverOnTheFly = true;
}

atMemoryLimit = totalUsage > MaxMemory; // inhibit forking
if (!atMemoryLimit)
return true;
Expand Down

0 comments on commit bf98cd2

Please sign in to comment.