@@ -1944,7 +1944,7 @@ PyDoc_STRVAR(malloc_info__doc__,
1944
1944
\n\
1945
1945
Memory allocator info as a named tuple." );
1946
1946
1947
- static PyTypeObject * MallocInfoType ;
1947
+ static PyTypeObject MallocInfoType ;
1948
1948
1949
1949
static PyStructSequence_Field malloc_info_fields [] = {
1950
1950
{"allocator" , "current memory allocator" },
@@ -1970,7 +1970,7 @@ make_malloc_info(void)
1970
1970
PyObject * v ;
1971
1971
int pos = 0 ;
1972
1972
1973
- malloc_info = PyStructSequence_New (MallocInfoType );
1973
+ malloc_info = PyStructSequence_New (& MallocInfoType );
1974
1974
if (malloc_info == NULL ) {
1975
1975
return NULL ;
1976
1976
}
@@ -3216,8 +3216,6 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
3216
3216
SET_SYS_FROM_STRING ("_vpath" , VPATH );
3217
3217
#endif
3218
3218
3219
- #undef ENSURE_INFO_TYPE
3220
-
3221
3219
/* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
3222
3220
#if _PY_SHORT_FLOAT_REPR == 1
3223
3221
SET_SYS_FROM_STRING ("float_repr_style" , "short" );
@@ -3228,14 +3226,11 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
3228
3226
SET_SYS ("thread_info" , PyThread_GetInfo ());
3229
3227
3230
3228
/* malloc_info */
3231
- if (MallocInfoType == NULL ) {
3232
- MallocInfoType = PyStructSequence_NewType (& malloc_info_desc );
3233
- if (MallocInfoType == NULL ) {
3234
- goto type_init_failed ;
3235
- }
3236
- }
3229
+ ENSURE_INFO_TYPE (MallocInfoType , malloc_info_desc );
3237
3230
SET_SYS ("_malloc_info" , make_malloc_info ());
3238
3231
3232
+ #undef ENSURE_INFO_TYPE
3233
+
3239
3234
/* initialize asyncgen_hooks */
3240
3235
if (AsyncGenHooksType .tp_name == NULL ) {
3241
3236
if (_PyStructSequence_InitBuiltin (
@@ -3502,7 +3497,7 @@ _PySys_Fini(PyInterpreterState *interp)
3502
3497
#ifdef __EMSCRIPTEN__
3503
3498
Py_CLEAR (EmscriptenInfoType );
3504
3499
#endif
3505
- Py_CLEAR ( MallocInfoType );
3500
+ _PyStructSequence_FiniType ( & MallocInfoType );
3506
3501
}
3507
3502
}
3508
3503
0 commit comments