mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists (gh-114899)
This commit is contained in:
parent
564385612c
commit
d4d5bae147
20 changed files with 38 additions and 107 deletions
|
|
@ -14,7 +14,6 @@ extern PyTypeObject _PyContextTokenMissing_Type;
|
|||
/* runtime lifecycle */
|
||||
|
||||
PyStatus _PyContext_Init(PyInterpreterState *);
|
||||
void _PyContext_Fini(_PyFreeListState *);
|
||||
|
||||
|
||||
/* other API */
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ extern "C" {
|
|||
|
||||
extern void _PyFloat_InitState(PyInterpreterState *);
|
||||
extern PyStatus _PyFloat_InitTypes(PyInterpreterState *);
|
||||
extern void _PyFloat_Fini(_PyFreeListState *);
|
||||
extern void _PyFloat_FiniType(PyInterpreterState *);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,16 @@ typedef struct _Py_freelist_state {
|
|||
struct _Py_object_stack_state object_stacks;
|
||||
} _PyFreeListState;
|
||||
|
||||
extern void _PyObject_ClearFreeLists(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyTuple_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyFloat_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyList_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PySlice_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyDict_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyAsyncGen_ClearFreeLists(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyContext_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyObjectStackChunk_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -279,14 +279,6 @@ extern PyObject *_PyGC_GetReferrers(PyInterpreterState *interp, PyObject *objs);
|
|||
|
||||
// Functions to clear types free lists
|
||||
extern void _PyGC_ClearAllFreeLists(PyInterpreterState *interp);
|
||||
extern void _Py_ClearFreeLists(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyTuple_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyFloat_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyList_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PySlice_ClearCache(_PyFreeListState *state);
|
||||
extern void _PyDict_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyAsyncGen_ClearFreeLists(_PyFreeListState *state, int is_finalization);
|
||||
extern void _PyContext_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
extern void _Py_ScheduleGC(PyInterpreterState *interp);
|
||||
extern void _Py_RunGC(PyThreadState *tstate);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ extern PyTypeObject _PyCoroWrapper_Type;
|
|||
extern PyTypeObject _PyAsyncGenWrappedValue_Type;
|
||||
extern PyTypeObject _PyAsyncGenAThrow_Type;
|
||||
|
||||
/* runtime lifecycle */
|
||||
|
||||
extern void _PyAsyncGen_Fini(_PyFreeListState *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,12 +13,6 @@ extern "C" {
|
|||
extern PyObject* _PyList_Extend(PyListObject *, PyObject *);
|
||||
extern void _PyList_DebugMallocStats(FILE *out);
|
||||
|
||||
|
||||
/* runtime lifecycle */
|
||||
|
||||
extern void _PyList_Fini(_PyFreeListState *);
|
||||
|
||||
|
||||
#define _PyList_ITEMS(op) _Py_RVALUE(_PyList_CAST(op)->ob_item)
|
||||
|
||||
extern int
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ _PyObjectStackChunk_New(void);
|
|||
extern void
|
||||
_PyObjectStackChunk_Free(_PyObjectStackChunk *);
|
||||
|
||||
extern void
|
||||
_PyObjectStackChunk_ClearFreeList(_PyFreeListState *state, int is_finalization);
|
||||
|
||||
// Push an item onto the stack. Return -1 on allocation failure, 0 on success.
|
||||
static inline int
|
||||
_PyObjectStack_Push(_PyObjectStack *stack, PyObject *obj)
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ extern "C" {
|
|||
|
||||
/* runtime lifecycle */
|
||||
|
||||
extern void _PySlice_Fini(_PyFreeListState *);
|
||||
|
||||
extern PyObject *
|
||||
_PyBuildSlice_ConsumeRefs(PyObject *start, PyObject *stop);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ extern void _PyTuple_DebugMallocStats(FILE *out);
|
|||
/* runtime lifecycle */
|
||||
|
||||
extern PyStatus _PyTuple_InitGlobalObjects(PyInterpreterState *);
|
||||
extern void _PyTuple_Fini(_PyFreeListState *);
|
||||
|
||||
|
||||
/* other API */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue