gh-135379: Move PyLong_CheckCompact to private header and rename it (GH-135707)

This commit is contained in:
Ken Jin 2025-06-19 21:09:09 +08:00 committed by GitHub
parent ff639af8ee
commit 0243260284
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 26 deletions

View file

@ -124,12 +124,6 @@ _PyLong_IsCompact(const PyLongObject* op) {
return op->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS);
}
static inline int
PyLong_CheckCompact(PyObject *op)
{
return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op);
}
#define PyUnstable_Long_IsCompact _PyLong_IsCompact
static inline Py_ssize_t

View file

@ -312,6 +312,12 @@ _PyLong_FlipSign(PyLongObject *op) {
#define _PyLong_FALSE_TAG TAG_FROM_SIGN_AND_SIZE(0, 0)
#define _PyLong_TRUE_TAG TAG_FROM_SIGN_AND_SIZE(1, 1)
static inline int
_PyLong_CheckExactAndCompact(PyObject *op)
{
return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op);
}
#ifdef __cplusplus
}
#endif