mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
ObjectSpace::WeakMap: fix compaction support
[Bug #19529] `rb_gc_update_tbl_refs` can't be used on `w->obj2wmap` because it's not a `VALUE -> VALUE` table, but a `VALUE -> VALUE *` table, so we need some dedicated iterator.
This commit is contained in:
parent
ac65ce16e9
commit
548086b34e
Notes:
git
2025-06-06 00:31:58 +00:00
2 changed files with 44 additions and 1 deletions
|
@ -176,4 +176,12 @@ class TestWeakMap < Test::Unit::TestCase
|
|||
end
|
||||
end;
|
||||
end
|
||||
|
||||
def test_compaction_bug_19529
|
||||
obj = Object.new
|
||||
100.times do |i|
|
||||
GC.compact
|
||||
@wm[i] = obj
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue