mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
GH-117108: Set the "old space bit" to "visited" for all young objects (#117213)
Change old space bit of young objects from 0 to gcstate->visited_space. This ensures that any object created *and* collected during cycle GC has the bit set correctly.
This commit is contained in:
parent
bf82f77957
commit
8bef34f625
5 changed files with 56 additions and 43 deletions
|
|
@ -318,8 +318,8 @@ static inline void _PyObject_GC_TRACK(
|
|||
PyGC_Head *last = (PyGC_Head*)(generation0->_gc_prev);
|
||||
_PyGCHead_SET_NEXT(last, gc);
|
||||
_PyGCHead_SET_PREV(gc, last);
|
||||
_PyGCHead_SET_NEXT(gc, generation0);
|
||||
assert((gc->_gc_next & _PyGC_NEXT_MASK_OLD_SPACE_1) == 0);
|
||||
/* Young objects will be moved into the visited space during GC, so set the bit here */
|
||||
gc->_gc_next = ((uintptr_t)generation0) | interp->gc.visited_space;
|
||||
generation0->_gc_prev = (uintptr_t)gc;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue