aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/gc_free_threading.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/gc_free_threading.c')
-rw-r--r--Python/gc_free_threading.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Python/gc_free_threading.c b/Python/gc_free_threading.c
index 1969ed608ea..986d80c18d3 100644
--- a/Python/gc_free_threading.c
+++ b/Python/gc_free_threading.c
@@ -1953,16 +1953,22 @@ custom_visitor_wrapper(const mi_heap_t *heap, const mi_heap_area_t *area,
}
void
-PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void *arg)
+_PyGC_VisitObjectsWorldStopped(PyInterpreterState *interp,
+ gcvisitobjects_t callback, void *arg)
{
- PyInterpreterState *interp = _PyInterpreterState_GET();
struct custom_visitor_args wrapper = {
.callback = callback,
.arg = arg,
};
+ gc_visit_heaps(interp, &custom_visitor_wrapper, &wrapper.base);
+}
+void
+PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void *arg)
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
_PyEval_StopTheWorld(interp);
- gc_visit_heaps(interp, &custom_visitor_wrapper, &wrapper.base);
+ _PyGC_VisitObjectsWorldStopped(interp, callback, arg);
_PyEval_StartTheWorld(interp);
}