Skip to content

Commit e519469

Browse files
committed
gh-128954: Reorder _PyInterpreterFrame fields for reduced memory usage
This reduces the size of _PyInterpreterFrame by 8 bytes on 64-bit platforms using the free threading build due to alignment requirements. This allows for slightly more recursive calls into the interpreter (from C), but `test_call.test_super_deep` still crashes.
1 parent d95ba9f commit e519469

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/internal/pycore_frame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ typedef struct _PyInterpreterFrame {
6868
PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
6969
PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
7070
_Py_CODEUNIT *instr_ptr; /* Instruction currently executing (or about to begin) */
71+
_PyStackRef *stackpointer;
7172
#ifdef Py_GIL_DISABLED
7273
/* Index of thread-local bytecode containing instr_ptr. */
7374
int32_t tlbc_index;
7475
#endif
75-
_PyStackRef *stackpointer;
7676
uint16_t return_offset; /* Only relevant during a function call */
7777
char owner;
7878
char visited;

0 commit comments

Comments
 (0)