Skip to content

Commit 9f86b6e

Browse files
committed
review comments part 2
1 parent 644e85a commit 9f86b6e

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

Objects/longobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ _PyLong_FromMedium(sdigit x)
222222
assert(!IS_SMALL_INT(x));
223223
assert(is_medium_int(x));
224224

225-
// The small int cache is incompatible with _Py_NewReference which is called
226-
// by _Py_FREELIST_POP.
225+
// We use _Py_FREELIST_POP_MEM instead of _Py_FREELIST_POP because the new
226+
// reference is created in _PyObject_Init
227227
PyLongObject *v = (PyLongObject *)_Py_FREELIST_POP_MEM(ints);
228228
if (v == NULL) {
229229
v = PyObject_Malloc(sizeof(PyLongObject));

Python/bytecodes.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ dummy_func(
515515

516516
STAT_INC(BINARY_OP, hit);
517517
PyObject *res_o = _PyLong_Multiply((PyLongObject *)left_o, (PyLongObject *)right_o);
518-
PyStackRef_CLOSE_SPECIALIZED(right, (destructor)_PyLong_ExactDealloc);
519-
PyStackRef_CLOSE_SPECIALIZED(left, (destructor)_PyLong_ExactDealloc);
518+
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
519+
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
520520
INPUTS_DEAD();
521521
ERROR_IF(res_o == NULL, error);
522522
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -528,8 +528,8 @@ dummy_func(
528528

529529
STAT_INC(BINARY_OP, hit);
530530
PyObject *res_o = _PyLong_Add((PyLongObject *)left_o, (PyLongObject *)right_o);
531-
PyStackRef_CLOSE_SPECIALIZED(right, (destructor)_PyLong_ExactDealloc);
532-
PyStackRef_CLOSE_SPECIALIZED(left, (destructor)_PyLong_ExactDealloc);
531+
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
532+
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
533533
INPUTS_DEAD();
534534
ERROR_IF(res_o == NULL, error);
535535
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -541,8 +541,8 @@ dummy_func(
541541

542542
STAT_INC(BINARY_OP, hit);
543543
PyObject *res_o = _PyLong_Subtract((PyLongObject *)left_o, (PyLongObject *)right_o);
544-
PyStackRef_CLOSE_SPECIALIZED(right, (destructor)_PyLong_ExactDealloc);
545-
PyStackRef_CLOSE_SPECIALIZED(left, (destructor)_PyLong_ExactDealloc);
544+
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
545+
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
546546
INPUTS_DEAD();
547547
ERROR_IF(res_o == NULL, error);
548548
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -798,7 +798,7 @@ dummy_func(
798798
PyObject *res_o = PyList_GET_ITEM(list, index);
799799
assert(res_o != NULL);
800800
Py_INCREF(res_o);
801-
PyStackRef_CLOSE_SPECIALIZED(sub_st, (destructor)_PyLong_ExactDealloc);
801+
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
802802
DEAD(sub_st);
803803
PyStackRef_CLOSE(list_st);
804804
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -818,7 +818,7 @@ dummy_func(
818818
DEOPT_IF(Py_ARRAY_LENGTH(_Py_SINGLETON(strings).ascii) <= c);
819819
STAT_INC(BINARY_SUBSCR, hit);
820820
PyObject *res_o = (PyObject*)&_Py_SINGLETON(strings).ascii[c];
821-
PyStackRef_CLOSE_SPECIALIZED(sub_st, (destructor)_PyLong_ExactDealloc);
821+
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
822822
DEAD(sub_st);
823823
PyStackRef_CLOSE(str_st);
824824
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -839,7 +839,7 @@ dummy_func(
839839
PyObject *res_o = PyTuple_GET_ITEM(tuple, index);
840840
assert(res_o != NULL);
841841
Py_INCREF(res_o);
842-
PyStackRef_CLOSE_SPECIALIZED(sub_st, (destructor)_PyLong_ExactDealloc);
842+
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
843843
DEAD(sub_st);
844844
PyStackRef_CLOSE(tuple_st);
845845
res = PyStackRef_FromPyObjectSteal(res_o);
@@ -951,7 +951,7 @@ dummy_func(
951951
PyList_SET_ITEM(list, index, PyStackRef_AsPyObjectSteal(value));
952952
assert(old_value != NULL);
953953
Py_DECREF(old_value);
954-
PyStackRef_CLOSE_SPECIALIZED(sub_st, (destructor)_PyLong_ExactDealloc);
954+
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
955955
DEAD(sub_st);
956956
PyStackRef_CLOSE(list_st);
957957
}

Python/executor_cases.c.h

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)