Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-92955: fix memory leak in code object lines and positions iterators #92956

Merged
merged 2 commits into from May 19, 2022

Conversation

kumaraditya303
Copy link
Contributor

Closes #92955

@corona10 corona10 requested a review from vstinner May 19, 2022 13:27
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vstinner @erlend-aasland
I am not sure that we need to handle all these cases,
or is it better to wait for approval for converting static types into heap types from SC

@kumaraditya303
Copy link
Contributor Author

These are the last static types which are accessible from python which are not finalized by the interpreter exit in core objects (Objects directory).

Also IIUC Heap types should be only used in extension modules not for interpreter core objects.

From PEP 687:

Static types that do not need module state access, and have no other reason to be converted, should stay static.

@kumaraditya303
Copy link
Contributor Author

Just to be clear this PR has nothing to do with conversion of static types to heap types. This PR only fixes a memory leak as static type was not finalized and is now finalized like other static types.

@corona10
Copy link
Member

corona10 commented May 19, 2022

These are the last static types which are accessible from python which are not finalized by the interpreter exit in core
objects (Objects directory).

That's nice

About heap types..

I just asked about one of Victor's last suggestions.
: #91727 (comment)

@kumaraditya303
Copy link
Contributor Author

Victor: Add the type to the static_types list in object.c (I tried to add all types there),

I am finishing off his work of adding all static types which need to be finalized at exit and these are the last ones left.

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this will be the last change under Objects/*.c, I am happy to approve this change.

@corona10 corona10 merged commit c5f5f97 into python:main May 19, 2022
@kumaraditya303 kumaraditya303 deleted the codeobject branch May 19, 2022 13:58
@kumaraditya303
Copy link
Contributor Author

Thanks @corona10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak in code object lines and positions iterator
3 participants