8000 gh-129149: Add fast path for medium-size integers in `PyLong_FromSsize_t()` by chris-eibl · Pull Request #129301 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-129149: Add fast path for medium-size integers in PyLong_FromSsize_t() #129301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 13, 2025
Merged
Prev Previous commit
Next Next commit
Address Sergey's review
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
  • Loading branch information
chris-eibl and skirpichev authored Jan 26, 2025
commit c59bef098566fcb9140746aebd9f572ea270a7f4
2 changes: 1 addition & 1 deletion Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ _PyLong_Negate(PyLongObject **x_p)
t >>= PyLong_SHIFT; \
} \
/* Construct output value. */ \
v = long_alloc(ndigits); \
PyLongObject *v = long_alloc(ndigits); \
if (v != NULL) { \
digit *p = v->long_value.ob_digit; \
_PyLong_SetSignAndDigitCount(v, ival < 0 ? -1 : 1, ndigits); \
Expand Down
Loading
0