Skip to content

Commit

Permalink
Merge pull request #219 from casperisfine/yjit-3.3-postponed-jbos
Browse files Browse the repository at this point in the history
Don't use postponed jobs on Ruby 3.3+YJIT
  • Loading branch information
tenderlove committed Nov 9, 2023
2 parents 726a172 + c1e71bd commit 91d12e7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion lib/stackprof.rb
Expand Up @@ -5,7 +5,11 @@
end

if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
StackProf.use_postponed_job!
if RUBY_VERSION < "3.3"
# On 3.3 we don't need postponed jobs:
# https://github.com/ruby/ruby/commit/a1dc1a3de9683daf5a543d6f618e17aabfcb8708
StackProf.use_postponed_job!
end
elsif RUBY_VERSION == "3.2.0"
# 3.2.0 crash is the signal is received at the wrong time.
# Fixed in https://github.com/ruby/ruby/pull/7116
Expand Down
2 changes: 1 addition & 1 deletion test/test_middleware.rb
Expand Up @@ -4,7 +4,7 @@
require 'minitest/autorun'
require 'tmpdir'

class StackProf::MiddlewareTest < MiniTest::Test
class StackProf::MiddlewareTest < Minitest::Test

def test_path_default
StackProf::Middleware.new(Object.new)
Expand Down
4 changes: 2 additions & 2 deletions test/test_report.rb
Expand Up @@ -2,7 +2,7 @@
require 'stackprof'
require 'minitest/autorun'

class ReportDumpTest < MiniTest::Test
class ReportDumpTest < Minitest::Test
require 'stringio'

def test_dump_to_stdout
Expand Down Expand Up @@ -33,7 +33,7 @@ def assert_dump(expected, marshal_data)
end
end

class ReportReadTest < MiniTest::Test
class ReportReadTest < Minitest::Test
require 'pathname'

def test_from_file_read_json
Expand Down
2 changes: 1 addition & 1 deletion test/test_stackprof.rb
Expand Up @@ -4,7 +4,7 @@
require 'tempfile'
require 'pathname'

class StackProfTest < MiniTest::Test
class StackProfTest < Minitest::Test
def setup
Object.new # warm some caches to avoid flakiness
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_truffleruby.rb
Expand Up @@ -3,7 +3,7 @@
require 'minitest/autorun'

if RUBY_ENGINE == 'truffleruby'
class StackProfTruffleRubyTest < MiniTest::Test
class StackProfTruffleRubyTest < Minitest::Test
def test_error
error = assert_raises RuntimeError do
StackProf.run(mode: :cpu) do
Expand Down

0 comments on commit 91d12e7

Please sign in to comment.