X Tutup
The Wayback Machine - https://web.archive.org/web/20220519144940/https://github.com/python/cpython/pull/92956
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

@kumaraditya303 kumaraditya303 commented May 19, 2022

Closes #92955

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

@corona10 corona10 left a comment

@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

@kumaraditya303 kumaraditya303 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).

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

@kumaraditya303 kumaraditya303 commented May 19, 2022

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

@kumaraditya303 kumaraditya303 commented May 19, 2022

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

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
13 checks passed
@kumaraditya303 kumaraditya303 deleted the codeobject branch May 19, 2022
@kumaraditya303
Copy link
Contributor Author

@kumaraditya303 kumaraditya303 commented May 19, 2022

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.

3 participants
X Tutup