Skip to content

Commit 8d2d3c9

Browse files
committed
perf(longobject): add wide int fast path
1 parent a4b3e95 commit 8d2d3c9

11 files changed

Lines changed: 1818 additions & 1542 deletions

Include/internal/pycore_long.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,12 @@ _PyLong_TryAsInt64Exact(PyLongObject *v, int64_t *out)
438438
return false;
439439
}
440440

441+
static inline int
442+
_PyLong_CheckExactAndFitsInt64(PyObject *op)
443+
{
444+
return PyLong_CheckExact(op) && _PyLong_FitsInt64((const PyLongObject *)op);
445+
}
446+
441447
#ifdef __cplusplus
442448
}
443449
#endif

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)