зеркало из https://github.com/github/ruby.git
18 строки
425 B
Ruby
18 строки
425 B
Ruby
|
require "test/unit"
|
||
|
|
||
|
class TestObjSpaceRactor < Test::Unit::TestCase
|
||
|
def test_tracing_does_not_crash
|
||
|
assert_ractor(<<~RUBY, require: 'objspace')
|
||
|
ObjectSpace.trace_object_allocations do
|
||
|
r = Ractor.new do
|
||
|
obj = 'a' * 1024
|
||
|
Ractor.yield obj
|
||
|
end
|
||
|
|
||
|
r.take
|
||
|
r.take
|
||
|
end
|
||
|
RUBY
|
||
|
end
|
||
|
end
|