We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31f1155 commit 6c62b40Copy full SHA for 6c62b40
1 file changed
Python/pystate.c
@@ -3510,7 +3510,14 @@ PyInterpreterView_FromMain(void)
3510
// thread state was attached.
3511
// To do this, we just use the memory address of a global variable and
3512
// cast it to a PyThreadState *.
3513
+#ifdef Py_DEBUG
3514
+// For debugging, use a null thread state. Since thread states are large, we
3515
+// don't want to do this on release builds.
3516
static const PyThreadState _no_tstate_sentinel = {0};
3517
+#else
3518
+static const uint8_t _no_tstate_sentinel = 0;
3519
+#endif
3520
+
3521
#define NO_TSTATE_SENTINEL ((PyThreadState *)&_no_tstate_sentinel)
3522
3523
static inline void
0 commit comments