Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/LinuxPerf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,12 @@ macro pstats(args...)
val = $(esc(expr))
disable_all!()
# trick the compiler not to eliminate the code
stats = rand() < 0 ? val : Stats(bench)
@static if isdefined(Base, :donotdelete)
Base.donotdelete(val)
stats = Stats(bench)
else
stats = @noinline rand() < 0 ? val : Stats(bench)
end
return stats::Stats
catch
rethrow()
Expand Down