Skip to content
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion src/LinuxPerf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1140,9 +1140,12 @@ macro pstats(args...)
try
enable_all!()
val = $(esc(expr))
@static if isdefined(Base, :donotdelete)
Base.donotdelete(val)
end
disable_all!()
# trick the compiler not to eliminate the code
stats = rand() < 0 ? val : Stats(bench)
stats = @noinline rand() < 0 ? val : Stats(bench)
return stats::Stats
catch
rethrow()
Expand Down