You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On an x86-64 GCC build, Memo in Parser/pegen.h occupies 32 bytes. Its current field order is:
inttype;
void*node;
intmark;
struct_memo*next;
This introduces two 4-byte alignment gaps. Moving mark immediately after type reduces the structure to 24 bytes without changing any field types.
These entries are allocated through _PyArena_Malloc(), which rounds allocations to 8-byte boundaries. The proposed layout therefore saves 8 bytes per entry within the arena.
The size reduction was verified with a standalone GCC layout check.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
Merge branch 'main' into pythongh-160245
gh-160245: Reduce padding in the Memo struct in the parser (#160266)