mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[Bug #18014] Fix rb_gc_force_recycle unmark before sweep
If we force recycle an object before the page is swept, we should clear it in the mark bitmap. If we don't clear it in the bitmap, then during sweeping we won't account for this free slot so the `free_slots` count of the page will be incorrect.
This commit is contained in:
parent
3e7a7fb28a
commit
119697f61e
Notes:
git
2021-07-16 00:49:21 +09:00
1 changed files with 1 additions and 1 deletions
2
gc.c
2
gc.c
|
@ -8671,7 +8671,7 @@ rb_gc_force_recycle(VALUE obj)
|
|||
}
|
||||
else {
|
||||
#endif
|
||||
if (is_old || !GET_HEAP_PAGE(obj)->flags.before_sweep) {
|
||||
if (is_old || GET_HEAP_PAGE(obj)->flags.before_sweep) {
|
||||
CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj);
|
||||
}
|
||||
CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
|
||||
|
|
Loading…
Add table
Reference in a new issue