-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
In the implementation of the reference cycle garbage collector, gc.c
file, I have noticed that we use the following for-loop
pattern over and over to traverse a PyGC_Head
list:
for (gc = GC_NEXT(list); gc != list; gc = GC_NEXT(gc)) {
/* ... */
}
However, in pycore_llist.h
we avoided that by using llist_for_each
macro as:
// Iterate over a list.
#define llist_for_each(node, head) \
for (node = (head)->next; node != (head); node = node->next)
I propose adding a new macro as gc_list_for_each
to the gc_list_xxx
family to serve the same purpose:
#define gc_list_for_each(gc, list) \
for (gc = GC_NEXT((list)); gc != (list); gc = GC_NEXT(gc))
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtype-featureA feature request or enhancementA feature request or enhancement