summaryrefslogtreecommitdiff
path: root/spec/ruby/core/process/spawn_spec.rb
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2023-06-25 12:26:20 +0900
committernagachika <nagachika@ruby-lang.org>2023-06-25 12:26:20 +0900
commit3ebcbb537d7ae37e49c49e05b28d2cc5b324f151 (patch)
treed93af72ec769e7d40583503b6e12212295ef7427 /spec/ruby/core/process/spawn_spec.rb
parenta048f7882a13e96080021a5bc13ef1fb293b4985 (diff)
merge revision(s) 548086b34e3dd125edabf5dc1e46b891fad3ea9c,3dc8cde70078ccb38f5f4b0818ad5eecded01bd5,e0cf80d666d4b5df3229f030a16d10d21323508e: [Backport #19529]
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. --- test/ruby/test_weakmap.rb | 8 ++++++++ weakmap.c | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) Fix crash during compaction [Bug #19529] The fix for [Bug #19529] in commit 548086b contained a bug that crashes on the following script: ``` wm = ObjectSpace::WeakMap.new obj = Object.new 100.times do wm[Object.new] = obj GC.start end GC.compact ``` --- test/ruby/test_weakmap.rb | 10 ++++++++++ weakmap.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) Fix incorrect size of WeakMap buffer In wmap_final_func, j is the number of elements + 1 (since j also includes the length at the 0th index), so we should resize the buffer to size j and the new length is j - 1. --- weakmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Diffstat (limited to 'spec/ruby/core/process/spawn_spec.rb')
0 files changed, 0 insertions, 0 deletions