File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -222,19 +222,17 @@ _PyLong_FromMedium(sdigit x)
222222 assert (!IS_SMALL_INT (x ));
223223 assert (is_medium_int (x ));
224224
225- // We use _Py_FREELIST_POP_MEM instead of _Py_FREELIST_POP because the new
226- // reference is created in _PyObject_Init
227- PyLongObject * v = (PyLongObject * )_Py_FREELIST_POP_MEM (ints );
225+ PyLongObject * v = (PyLongObject * )_Py_FREELIST_POP (PyLongObject , ints );
228226 if (v == NULL ) {
229227 v = PyObject_Malloc (sizeof (PyLongObject ));
230228 if (v == NULL ) {
231229 PyErr_NoMemory ();
232230 return NULL ;
233231 }
232+ _PyObject_Init ((PyObject * )v , & PyLong_Type );
234233 }
235234 digit abs_x = x < 0 ? - x : x ;
236235 _PyLong_SetSignAndDigitCount (v , x < 0 ?-1 :1 , 1 );
237- _PyObject_Init ((PyObject * )v , & PyLong_Type );
238236 v -> long_value .ob_digit [0 ] = abs_x ;
239237 return (PyObject * )v ;
240238}
You can’t perform that action at this time.
0 commit comments