Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proposal to add gc_list_for_each macro #133058

Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedtype-featureA feature request or enhancement
@nybblista

Description

@nybblista

Feature or enhancement

Proposal:

In the implementation of the reference cycle garbage collector,gc.c file, I have noticed that we use the followingfor-loop pattern over and over to traverse aPyGC_Head list:

for (gc=GC_NEXT(list);gc!=list;gc=GC_NEXT(gc)) {/* ... */}

However, inpycore_llist.h we avoided that by usingllist_for_each macro as:

// Iterate over a list.#definellist_for_each(node,head) \    for (node = (head)->next; node != (head); node = node->next)

I propose adding a new macro asgc_list_for_each to thegc_list_xxx family to serve the same purpose:

#definegc_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

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp