Skip to content

gh-148989: _remote_debugging: Remove dead code, unnecessary gc state read#148990

Merged
pablogsal merged 1 commit intopython:mainfrom
maurycy:remove-orphan-gc-state-read
Apr 25, 2026
Merged

gh-148989: _remote_debugging: Remove dead code, unnecessary gc state read#148990
pablogsal merged 1 commit intopython:mainfrom
maurycy:remove-orphan-gc-state-read

Conversation

@maurycy
Copy link
Copy Markdown
Contributor

@maurycy maurycy commented Apr 25, 2026

I don't think it warrants a NEWS. It should've been removed with 274a26c. There's no gc_state reader anymore. It should obviously reduce the memory pressure, but I didn't measure it.


// Read the GC runtime state from the interpreter state
uintptr_t gc_addr = interp_addr + unwinder->debug_offsets.interpreter_state.gc;
char gc_state[SIZEOF_GC_RUNTIME_STATE];
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SIZEOF_GC_RUNTIME_STATE has to stay:

PY_REMOTE_DEBUG_VALIDATE_READ_SECTION(gc, SIZEOF_GC_RUNTIME_STATE);

uintptr_t gc_frame = 0;
if (self->gc) {
gc_frame = GET_MEMBER(uintptr_t, interp_state_buffer,
self->debug_offsets.interpreter_state.gc
+ self->debug_offsets.gc.frame);
}

@pablogsal
Copy link
Copy Markdown
Member

Thanks a lot for the PR @maurycy !

Copy link
Copy Markdown
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

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

LGTM

@pablogsal pablogsal merged commit b2f126c into python:main Apr 25, 2026
55 checks passed
@maurycy maurycy deleted the remove-orphan-gc-state-read branch April 25, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants