@@ -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
}
@@ -3139,8 +3139,6 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
3139
3139
SET_SYS_FROM_STRING ("_vpath" , VPATH );
3140
3140
#endif
3141
3141
3142
- #undef ENSURE_INFO_TYPE
3143
-
3144
3142
/* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
3145
3143
#if _PY_SHORT_FLOAT_REPR == 1
3146
3144
SET_SYS_FROM_STRING ("float_repr_style" , "short" );
@@ -3151,14 +3149,11 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
3151
3149
SET_SYS ("thread_info" , PyThread_GetInfo ());
3152
3150
3153
3151
/* malloc_info */
3154
- if (MallocInfoType == NULL ) {
3155
- MallocInfoType = PyStructSequence_NewType (& malloc_info_desc );
3156
- if (MallocInfoType == NULL ) {
3157
- goto type_init_failed ;
3158
- }
3159
- }
3152
+ ENSURE_INFO_TYPE (MallocInfoType , malloc_info_desc );
3160
3153
SET_SYS ("_malloc_info" , make_malloc_info ());
3161
3154
3155
+ #undef ENSURE_INFO_TYPE
3156
+
3162
3157
/* initialize asyncgen_hooks */
3163
3158
if (AsyncGenHooksType .tp_name == NULL ) {
3164
3159
if (_PyStructSequence_InitBuiltin (
@@ -3425,7 +3420,7 @@ _PySys_Fini(PyInterpreterState *interp)
3425
3420
#ifdef __EMSCRIPTEN__
3426
3421
Py_CLEAR (EmscriptenInfoType );
3427
3422
#endif
3428
- Py_CLEAR ( MallocInfoType );
3423
+ _PyStructSequence_FiniType ( & MallocInfoType );
3429
3424
}
3430
3425
}
3431
3426
0 commit comments