Lines Matching defs:list
8 Based on a post on the python-dev list. Ideas from Guido van Rossum,
13 The following mailing list threads provide a historical perspective on
62 // This flag represents the object is in unreachable list in move_unreachable()
67 // Between them, unreachable list is not normal list and we can not use
182 Between collections, _gc_prev is used for doubly linked list.
188 During a collection, _gc_prev is temporary used for gc_refs, and the gc list
212 Pointer to the next object in the GC list.
229 /*** list functions ***/
232 gc_list_init(PyGC_Head *list)
236 list->_gc_prev = (uintptr_t)list;
237 list->_gc_next = (uintptr_t)list;
241 gc_list_is_empty(PyGC_Head *list)
243 return (list->_gc_next == (uintptr_t)list);
246 /* Append `node` to `list`. */
248 gc_list_append(PyGC_Head *node, PyGC_Head *list)
250 PyGC_Head *last = (PyGC_Head *)list->_gc_prev;
256 // node <-> list
257 _PyGCHead_SET_NEXT(node, list);
258 list->_gc_prev = (uintptr_t)node;
261 /* Remove `node` from the gc list it's currently in. */
274 /* Move `node` from the gc list it's currently in (which is not explicitly
275 * named here) to the end of `list`. This is semantically the same as
276 * gc_list_remove(node) followed by gc_list_append(node, list).
279 gc_list_move(PyGC_Head *node, PyGC_Head *list)
281 /* Unlink from current list. */
287 /* Relink at end of new list. */
288 // list must not have flags. So we can skip macros.
289 PyGC_Head *to_prev = (PyGC_Head*)list->_gc_prev;
292 list->_gc_prev = (uintptr_t)node;
293 _PyGCHead_SET_NEXT(node, list);
296 /* append list `from` onto list `to`; `from` becomes an empty list */
318 gc_list_size(PyGC_Head *list)
322 for (gc = GC_NEXT(list); gc != list; gc = GC_NEXT(gc)) {
328 /* Walk the list and mark all objects as non-collecting */
338 /* Append objects in a GC list to a Python list.
339 * Return 0 if all OK, < 0 if error (out of memory for list)
363 // validate_list checks list consistency. And it works as document
365 // `head` must be a doubly-linked gc list, although it's fine (expected!) if
412 /*** end of list stuff ***/
435 * to remove the object from the doubly-linked list of all
497 // move_unreachable's scan of the 'young' list - they've already been
509 * Move it back to move_unreachable's 'young' list,
513 // Manually unlink gc from unreachable list because the list functions
528 /* This is in move_unreachable's 'young' list, but
537 * list, and move_unreachable will eventually get to it.
553 * doubly linked list after this function.
554 * But _gc_next in unreachable list has NEXT_MASK_UNREACHABLE flag.
560 // previous elem in the young list, used for restore gc_prev.
565 * (directly or indirectly) from outside the young list as it was at entry.
615 // But this may pollute the unreachable list head's 'next' pointer
625 // young->_gc_prev must be last element remained in the list.
627 // don't let the pollution of the list head's next pointer leak
698 /* Check that the list head does not have the unreachable bit set */
734 /* Note that the finalizers list may grow during this. */
801 /* `op` may have some weakrefs. March over the list, clear
923 * garbage list (a Python list), else only the objects in finalizers with
925 * merged into the old list regardless.
952 * list, due to refcounts falling to 0.
963 * `collectable` list across iterations. For safety, we always take the
964 * first object in that list and move it to a temporary `seen` list.
1031 * Allocated items in the free list may keep a pymalloc arena occupied.
1064 /* Deduce which objects among "base" are unreachable from outside the list
1075 them to the "unreachable" list. This step also needs to move back to "base" all
1081 * The "base" has to be a valid list with no mask set.
1083 * The "unreachable" list must be uninitialized (this function calls
1089 by a call to 'move_legacy_finalizers'), the 'unreachable' list is not a normal
1090 list and we can not use most gc_list_* functions for it. */
1116 * When move_unreachable finds A, A is moved to the unreachable list. The
1118 * _back_ to the reachable list. B is eventually traversed, and then A is
1119 * moved back to the reachable list.
1150 * The "still_unreachable" list must be uninitialized (this function calls
1249 // After move_legacy_finalizers(), unreachable is normal list.
1253 * and we move those into the finalizers list too.
1304 * reachable list of garbage. The programmer has to deal with
1310 /* Clear free list only during the collection of the highest
1440 long-lived objects (e.g. building a large list of GC-tracked objects would
1652 gc_referrers_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist)
1657 for (gc = GC_NEXT(list); gc != list; gc = GC_NEXT(gc)) {
1671 "get_referrers(*objs) -> list\n\
1672 Return the list of objects that directly refer to any of objs.");
1696 /* Append obj to list; return true if error (out of memory), false if OK. */
1698 referentsvisit(PyObject *obj, PyObject *list)
1700 return PyList_Append(list, obj) < 0;
1704 "get_referents(*objs) -> list\n\
1705 Return the list of objects that are directly referred to by objs.");
1741 Return a list of objects tracked by the collector (excluding the list returned).
1804 Return a list of dictionaries containing per-generation statistics.
1815 the result list, we use a snapshot of the running stats. */
1956 "get_stats() -- Return list of dictionaries containing per-generation stats.\n"
1961 "get_objects() -- Return a list of all objects tracked by the collector.\n"
1964 "get_referrers() -- Return the list of objects that refer to an object.\n"
1965 "get_referents() -- Return the list of objects that an object refers to.\n"
2127 "shutdown; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them";
2154 gc_fini_untrack(PyGC_Head *list)
2157 for (gc = GC_NEXT(list); gc != list; gc = GC_NEXT(list)) {