We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rand
Base.donotdelete
1 parent 174c1fa commit 624d863Copy full SHA for 624d863
src/LinuxPerf.jl
@@ -1140,12 +1140,14 @@ macro pstats(args...)
1140
try
1141
enable_all!()
1142
val = $(esc(expr))
1143
+ disable_all!()
1144
+ # trick the compiler not to eliminate the code
1145
@static if isdefined(Base, :donotdelete)
1146
Base.donotdelete(val)
1147
+ stats = Stats(bench)
1148
+ else
1149
+ stats = @noinline rand() < 0 ? val : Stats(bench)
1150
end
- disable_all!()
- # trick the compiler not to eliminate the code
- stats = @noinline rand() < 0 ? val : Stats(bench)
1151
return stats::Stats
1152
catch
1153
rethrow()
0 commit comments