Make PyXXX_Fini() functions private (GH-15531)

For example, rename PyTuple_Fini() to _PyTuple_Fini().

These functions are only declared in the internal C API.
This commit is contained in:
Victor Stinner 2019-08-27 00:12:32 +02:00 committed by GitHub
parent d3cc189b17
commit bed4817d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 38 additions and 36 deletions

View File

@ -62,18 +62,19 @@ extern PyStatus _PyImportZip_Init(PyThreadState *tstate);
/* Various internal finalizers */ /* Various internal finalizers */
extern void PyMethod_Fini(void); extern void _PyMethod_Fini(void);
extern void PyFrame_Fini(void); extern void _PyFrame_Fini(void);
extern void PyCFunction_Fini(void); extern void _PyCFunction_Fini(void);
extern void PyDict_Fini(void); extern void _PyDict_Fini(void);
extern void PyTuple_Fini(void); extern void _PyTuple_Fini(void);
extern void PyList_Fini(void); extern void _PyList_Fini(void);
extern void PySet_Fini(void); extern void _PySet_Fini(void);
extern void PyBytes_Fini(void); extern void _PyBytes_Fini(void);
extern void PyFloat_Fini(void); extern void _PyFloat_Fini(void);
extern void _PySlice_Fini(void);
extern void _PyAsyncGen_Fini(void);
extern void PyOS_FiniInterrupts(void); extern void PyOS_FiniInterrupts(void);
extern void PySlice_Fini(void);
extern void PyAsyncGen_Fini(void);
extern void _PyExc_Fini(void); extern void _PyExc_Fini(void);
extern void _PyImport_Fini(void); extern void _PyImport_Fini(void);
@ -82,7 +83,7 @@ extern void _PyGC_Fini(_PyRuntimeState *runtime);
extern void _PyType_Fini(void); extern void _PyType_Fini(void);
extern void _Py_HashRandomization_Fini(void); extern void _Py_HashRandomization_Fini(void);
extern void _PyUnicode_Fini(void); extern void _PyUnicode_Fini(void);
extern void PyLong_Fini(void); extern void _PyLong_Fini(void);
extern void _PyFaulthandler_Fini(void); extern void _PyFaulthandler_Fini(void);
extern void _PyHash_Fini(void); extern void _PyHash_Fini(void);
extern int _PyTraceMalloc_Fini(void); extern int _PyTraceMalloc_Fini(void);

View File

@ -3047,7 +3047,7 @@ error:
} }
void void
PyBytes_Fini(void) _PyBytes_Fini(void)
{ {
int i; int i;
for (i = 0; i < UCHAR_MAX + 1; i++) for (i = 0; i < UCHAR_MAX + 1; i++)

View File

@ -375,7 +375,7 @@ PyMethod_ClearFreeList(void)
} }
void void
PyMethod_Fini(void) _PyMethod_Fini(void)
{ {
(void)PyMethod_ClearFreeList(); (void)PyMethod_ClearFreeList();
} }

View File

@ -282,7 +282,7 @@ _PyDict_DebugMallocStats(FILE *out)
void void
PyDict_Fini(void) _PyDict_Fini(void)
{ {
PyDict_ClearFreeList(); PyDict_ClearFreeList();
} }

View File

@ -2031,7 +2031,7 @@ PyFloat_ClearFreeList(void)
} }
void void
PyFloat_Fini(void) _PyFloat_Fini(void)
{ {
(void)PyFloat_ClearFreeList(); (void)PyFloat_ClearFreeList();
} }

View File

@ -997,7 +997,7 @@ PyFrame_ClearFreeList(void)
} }
void void
PyFrame_Fini(void) _PyFrame_Fini(void)
{ {
(void)PyFrame_ClearFreeList(); (void)PyFrame_ClearFreeList();
} }

View File

@ -1463,7 +1463,7 @@ PyAsyncGen_ClearFreeLists(void)
} }
void void
PyAsyncGen_Fini(void) _PyAsyncGen_Fini(void)
{ {
PyAsyncGen_ClearFreeLists(); PyAsyncGen_ClearFreeLists();
} }

View File

@ -138,7 +138,7 @@ PyList_ClearFreeList(void)
} }
void void
PyList_Fini(void) _PyList_Fini(void)
{ {
PyList_ClearFreeList(); PyList_ClearFreeList();
} }

View File

@ -5869,7 +5869,7 @@ _PyLong_Init(void)
} }
void void
PyLong_Fini(void) _PyLong_Fini(void)
{ {
/* Integers are currently statically allocated. Py_DECREF is not /* Integers are currently statically allocated. Py_DECREF is not
needed, but Python must forget about the reference or multiple needed, but Python must forget about the reference or multiple

View File

@ -319,7 +319,7 @@ PyCFunction_ClearFreeList(void)
} }
void void
PyCFunction_Fini(void) _PyCFunction_Fini(void)
{ {
(void)PyCFunction_ClearFreeList(); (void)PyCFunction_ClearFreeList();
} }

View File

@ -2318,7 +2318,7 @@ PySet_ClearFreeList(void)
} }
void void
PySet_Fini(void) _PySet_Fini(void)
{ {
Py_CLEAR(emptyfrozenset); Py_CLEAR(emptyfrozenset);
} }

View File

@ -100,7 +100,8 @@ PyObject _Py_EllipsisObject = {
* created and then deleted again * created and then deleted again
*/ */
static PySliceObject *slice_cache = NULL; static PySliceObject *slice_cache = NULL;
void PySlice_Fini(void)
void _PySlice_Fini(void)
{ {
PySliceObject *obj = slice_cache; PySliceObject *obj = slice_cache;
if (obj != NULL) { if (obj != NULL) {

View File

@ -989,7 +989,7 @@ PyTuple_ClearFreeList(void)
} }
void void
PyTuple_Fini(void) _PyTuple_Fini(void)
{ {
#if PyTuple_MAXSAVESIZE > 0 #if PyTuple_MAXSAVESIZE > 0
/* empty tuples are used all over the place and applications may /* empty tuples are used all over the place and applications may

View File

@ -1307,22 +1307,22 @@ Py_FinalizeEx(void)
_PyExc_Fini(); _PyExc_Fini();
/* Sundry finalizers */ /* Sundry finalizers */
PyMethod_Fini(); _PyMethod_Fini();
PyFrame_Fini(); _PyFrame_Fini();
PyCFunction_Fini(); _PyCFunction_Fini();
PyTuple_Fini(); _PyTuple_Fini();
PyList_Fini(); _PyList_Fini();
PySet_Fini(); _PySet_Fini();
PyBytes_Fini(); _PyBytes_Fini();
PyLong_Fini(); _PyLong_Fini();
PyFloat_Fini(); _PyFloat_Fini();
PyDict_Fini(); _PyDict_Fini();
PySlice_Fini(); _PySlice_Fini();
_PyGC_Fini(runtime); _PyGC_Fini(runtime);
_PyWarnings_Fini(interp); _PyWarnings_Fini(interp);
_Py_HashRandomization_Fini(); _Py_HashRandomization_Fini();
_PyArg_Fini(); _PyArg_Fini();
PyAsyncGen_Fini(); _PyAsyncGen_Fini();
_PyContext_Fini(); _PyContext_Fini();
/* Cleanup Unicode implementation */ /* Cleanup Unicode implementation */