Age | Commit message (Collapse) | Author |
|
[Feature #19561]
It's useful to be able to remove references from weak maps.
Notes:
Merged: https://github.com/ruby/ruby/pull/7629
|
|
[Feature #18498]
Notes:
Merged: https://github.com/ruby/ruby/pull/7716
|
|
[Bug #19531]
```ruby
wmap[1] = "A"
wmap[1] = "B"
```
In the example above, we need to remove the `"A" => 1` inverse reference
so that when `"A"` is GCed the `1` key isn't deleted.
Notes:
Merged: https://github.com/ruby/ruby/pull/7540
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/7536
|
|
[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
```
|
|
[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.
Notes:
Merged: https://github.com/ruby/ruby/pull/7518
|
|
For both we mark the lambda finalizer.
ObjectSpace::WeakMap doesn't mark any other reference, so we can just add the flag.
ObjectSpace::WeakKeyMap only ever add new refs in `wkmap_aset`, so we can just trigger the write barrier there.
Notes:
Merged: https://github.com/ruby/ruby/pull/7498
|
|
These classes don't belong in gc.c as they're not actually part of the
GC. This commit refactors the code by moving all the code into a
weakmap.c file.
Notes:
Merged: https://github.com/ruby/ruby/pull/7451
|