mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)
Move private _PyGC_CollectNoFail() to the internal C API. Remove the private _PyGC_CollectIfEnabled() which was just an alias to the public PyGC_Collect() function since Python 3.8. Rename functions: * collect() => gc_collect_main() * collect_with_callback() => gc_collect_with_callback() * collect_generations() => gc_collect_generations()
This commit is contained in:
parent
99608c733c
commit
8b3414818f
5 changed files with 25 additions and 34 deletions
|
@ -79,10 +79,6 @@ PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
|
|||
PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
|
||||
|
||||
|
||||
PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void);
|
||||
PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void);
|
||||
|
||||
|
||||
/* Test if an object implements the garbage collector protocol */
|
||||
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
|
||||
|
||||
|
|
|
@ -161,7 +161,9 @@ struct _gc_runtime_state {
|
|||
Py_ssize_t long_lived_pending;
|
||||
};
|
||||
|
||||
PyAPI_FUNC(void) _PyGC_InitState(struct _gc_runtime_state *);
|
||||
extern void _PyGC_InitState(struct _gc_runtime_state *);
|
||||
|
||||
extern Py_ssize_t _PyGC_CollectNoFail(PyThreadState *tstate);
|
||||
|
||||
|
||||
// Functions to clear types free lists
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue