Skip to content

gh-160132: Reduce padding in _PyCfgBasicblock - #160149

Open
ashm-dev wants to merge 2 commits into
python:mainfrom
ashm-dev:gh-160132
Open

ashm-dev wants to merge 2 commits into
python:mainfrom
ashm-dev:gh-160132

Conversation

@ashm-dev

@ashm-dev ashm-dev commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Move the five bit-fields immediately after b_label to use the existing alignment gap.

On the tested x86-64 GCC build, this reduces sizeof(_PyCfgBasicblock) from 72 to 64 bytes without changing the offsets of the other fields. No compiler behavior or public API changes are intended.

Verified with pahole. The following tests pass on a --with-pydebug build: test_compile, test_peepholer, test_dis, test_compiler_assemble, test_compiler_codegen, test_capi.test_opt, test_exception_variations, and test_syntax.

Closes #160132.

@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce padding in _PyCfgBasicblock

2 participants