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

GH-144688: Fix refleaks in JIT when optimization fails#145420

Open
markshannon wants to merge 1 commit intopython:mainfrom
markshannon:fix-jit-refleak
Open

GH-144688: Fix refleaks in JIT when optimization fails#145420
markshannon wants to merge 1 commit intopython:mainfrom
markshannon:fix-jit-refleak

Conversation

@markshannon
Copy link
Member

@markshannonmarkshannon commentedMar 2, 2026
edited by bedevere-appbot
Loading

Make sure that we clear references to recorded objects when cleaning up JIT.

@markshannon
Copy link
MemberAuthor

Skipping news as this bug didn't make it into a release

// Clear all recorded values
_PyJitUopBuffer *buffer = &tracer->code_buffer;
for (_PyUOpInstruction *inst = buffer->start; inst < buffer->next; inst++) {
if (_PyUop_Flags[inst->opcode] & HAS_RECORDS_VALUE_FLAG) {

Choose a reason for hiding this comment

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

I think this means you can remove

        else if (_PyUop_Flags[opcode] & HAS_RECORDS_VALUE_FLAG) {            Py_XDECREF((PyObject *)(uintptr_t)buffer[pc].operand0);            buffer[pc].opcode = _NOP;        }

in optimizer.c to avoid double work?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We don't do double work:https://github.com/python/cpython/pull/145420/changes#diff-de09f74c4306be5ef0284d665091976873569094d645a35b48467ea2a11d67f7R1531 and it is faster to leave the cleanup in the fixup pass as we have to do that pass anyway in the normal, non-error case.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Fidget-SpinnerFidget-SpinnerFidget-Spinner left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@markshannon@Fidget-Spinner

[8]ページ先頭

©2009-2026 Movatter.jp