gh-97922: Run the GC only on eval breaker (#97920)

This commit is contained in:
Pablo Galindo Salgado 2022-10-08 07:57:09 -07:00 committed by GitHub
parent c66dbddfba
commit 83eb827247
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 74 additions and 14 deletions

View file

@ -202,6 +202,8 @@ extern void _PyList_ClearFreeList(PyInterpreterState *interp);
extern void _PyDict_ClearFreeList(PyInterpreterState *interp);
extern void _PyAsyncGen_ClearFreeLists(PyInterpreterState *interp);
extern void _PyContext_ClearFreeList(PyInterpreterState *interp);
extern void _Py_ScheduleGC(PyInterpreterState *interp);
extern void _Py_RunGC(PyThreadState *tstate);
#ifdef __cplusplus
}

View file

@ -49,6 +49,8 @@ struct _ceval_state {
_Py_atomic_int eval_breaker;
/* Request for dropping the GIL */
_Py_atomic_int gil_drop_request;
/* The GC is ready to be executed */
_Py_atomic_int gc_scheduled;
struct _pending_calls pending;
};