mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-127110)
* Mark almost all reachable objects before doing collection phase * Add stats for objects marked * Visit new frames before each increment * Update docs * Clearer calculation of work to do.
This commit is contained in:
parent
2a373da770
commit
a8dd821d5b
14 changed files with 365 additions and 113 deletions
|
@ -471,8 +471,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);
|
||||
/* Young objects will be moved into the visited space during GC, so set the bit here */
|
||||
gc->_gc_next = ((uintptr_t)generation0) | (uintptr_t)interp->gc.visited_space;
|
||||
uintptr_t not_visited = 1 ^ interp->gc.visited_space;
|
||||
gc->_gc_next = ((uintptr_t)generation0) | not_visited;
|
||||
generation0->_gc_prev = (uintptr_t)gc;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue