Luke Gruber 7ff036d59b Prevent GC from running during newobj_of for internal_event_newobj.
If another ractor is calling for GC, we need to prevent the current one
from joining the barrier. Otherwise, our half-built object will be marked.

The repro script was:

test.rb:
```ruby
require "objspace"
1000.times do
  ObjectSpace.trace_object_allocations do
    r = Ractor.new do
      _obj = 'a' * 1024
    end

    r.join
  end
end
```

$ untilfail lldb -b ./exe/ruby -o "target create ./exe/ruby" -o "run test.rb" -o continue

It would fail at `ractor_port_mark`, rp->r was a garbage value. Credit to John for finding the
solution.

Co-authored-by: John Hawthorn <john.hawthorn@shopify.com>
2025-09-18 13:52:37 -07:00
..