gh-158572: Add an external flag to interpreter frames (#158573)

Adds an `external` flag to a bit-packed byte on the
_PyInterpreterFrame struct in order to provide external frame
evaluators a way to distinguish VM-pushed frames vs externally-
pushed frames.
This commit is contained in:
Kevin Newton authored and GitHub committed 2026-10-08 16:45:03 -07:00
1 parent 560738126e
commit bc12b7285f
1 file changed
+3 -4
@@ -42,12 +42,11 @@ struct _PyInterpreterFrame {
#endif
uint16_t return_offset; /* Only relevant during a function call */
char owner;
#ifdef Py_DEBUG
uint8_t visited:1;
uint8_t external:1; /* Set when the frame was pushed by something other than the VM */
#ifdef Py_DEBUG
uint8_t stackpointer_valid:1;
uint8_t lltrace:6;
#else
uint8_t visited;
uint8_t lltrace:5;
#endif
/* Locals and stack */
_PyStackRef localsplus[1];