summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_frame.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-11-18 14:31:26 (GMT)
committerGitHub <noreply@github.com>2024-11-18 14:31:26 (GMT)
commitb0fcc2c47a34a69c35c1a8031cd0589d3747c1af (patch)
treeaa9d4bfaf49dca8d3ce47aa18a03cf2d5374a8e2 /Include/internal/pycore_frame.h
parenta1d9c8aa800dd7c9eb634f89646be10e9cfc9c8d (diff)
downloadcpython-b0fcc2c47a34a69c35c1a8031cd0589d3747c1af.zip
cpython-b0fcc2c47a34a69c35c1a8031cd0589d3747c1af.tar.gz
cpython-b0fcc2c47a34a69c35c1a8031cd0589d3747c1af.tar.bz2
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-126502)
* Mark almost all reachable objects before doing collection phase * Add stats for objects marked * Visit new frames before each increment * Remove lazy dict tracking * Update docs * Clearer calculation of work to do.
Diffstat (limited to 'Include/internal/pycore_frame.h')
-rw-r--r--Include/internal/pycore_frame.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index 8c01003..b786c5f 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -75,6 +75,7 @@ typedef struct _PyInterpreterFrame {
_PyStackRef *stackpointer;
uint16_t return_offset; /* Only relevant during a function call */
char owner;
+ char visited;
/* Locals and stack */
_PyStackRef localsplus[1];
} _PyInterpreterFrame;
@@ -207,6 +208,7 @@ _PyFrame_Initialize(
#endif
frame->return_offset = 0;
frame->owner = FRAME_OWNED_BY_THREAD;
+ frame->visited = 0;
for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
frame->localsplus[i] = PyStackRef_NULL;
@@ -389,6 +391,7 @@ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int
frame->instr_ptr = _PyCode_CODE(code);
#endif
frame->owner = FRAME_OWNED_BY_THREAD;
+ frame->visited = 0;
frame->return_offset = 0;
#ifdef Py_GIL_DISABLED