https://github.com/python/cpython/commit/bc12b7285f87f3ca9118cb4b61c28a84e7984ba3
commit: bc12b7285f87f3ca9118cb4b61c28a84e7984ba3
branch: main
author: Kevin Newton <[email protected]>
committer: DinoV <[email protected]>
date: 2026-10-08T16:45:03-07:00
summary:

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.

files:
M Include/internal/pycore_interpframe_structs.h

diff --git a/Include/internal/pycore_interpframe_structs.h 
b/Include/internal/pycore_interpframe_structs.h
index 560fb66a97fc89d..0d6a37cc2c1a17a 100644
--- a/Include/internal/pycore_interpframe_structs.h
+++ b/Include/internal/pycore_interpframe_structs.h
@@ -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];

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to