summaryrefslogtreecommitdiff
path: root/zjit.rb
diff options
context:
space:
mode:
authorRandy Stauner <randy@r4s6.net>2025-09-08 12:11:56 -0700
committerGitHub <noreply@github.com>2025-09-08 19:11:56 +0000
commit4263b7eb45f8eb67e3e46af64856736c84f5b73e (patch)
treeba48c59e24613323661f4573d24a4fc495784f4a /zjit.rb
parent80079ba42505d63cafac674bd23c0317e6a5cdd6 (diff)
ZJIT: Add RubyVM::ZJIT.reset_stats! method (GH-14479)
This allows for more precise tracking of stats programmatically which is particularly useful for our nightly benchmarking suite. - Define rust function - Expose to C - Wrap with Ruby API - Add a test
Diffstat (limited to 'zjit.rb')
-rw-r--r--zjit.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/zjit.rb b/zjit.rb
index d70ff1dd47..39b0e5eb22 100644
--- a/zjit.rb
+++ b/zjit.rb
@@ -29,6 +29,11 @@ class << RubyVM::ZJIT
Primitive.rb_zjit_stats(target_key)
end
+ # Discard statistics collected for `--zjit-stats`.
+ def reset_stats!
+ Primitive.rb_zjit_reset_stats_bang
+ end
+
# Get the summary of ZJIT statistics as a String
def stats_string
buf = +"***ZJIT: Printing ZJIT statistics on exit***\n"