mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-84436: Skip refcounting for known immortals (GH-107605)
This commit is contained in:
parent
ec0a0d2bd9
commit
05a824f294
19 changed files with 52 additions and 65 deletions
|
@ -174,7 +174,7 @@ _PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits)
|
|||
{
|
||||
assert(digit_count >= 0);
|
||||
if (digit_count == 0) {
|
||||
return (PyLongObject *)Py_NewRef(_PyLong_GetZero());
|
||||
return (PyLongObject *)_PyLong_GetZero();
|
||||
}
|
||||
PyLongObject *result = _PyLong_New(digit_count);
|
||||
if (result == NULL) {
|
||||
|
@ -2857,8 +2857,7 @@ long_divrem(PyLongObject *a, PyLongObject *b,
|
|||
if (*prem == NULL) {
|
||||
return -1;
|
||||
}
|
||||
PyObject *zero = _PyLong_GetZero();
|
||||
*pdiv = (PyLongObject*)Py_NewRef(zero);
|
||||
*pdiv = (PyLongObject*)_PyLong_GetZero();
|
||||
return 0;
|
||||
}
|
||||
if (size_b == 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue