[3.13] gh-123091: Use _Py_IsImmortalLoose() (#123511) (#123600)

gh-123091: Use _Py_IsImmortalLoose() (#123511)

Use _Py_IsImmortalLoose() in bytesobject.c, typeobject.c
and ceval.c.

(cherry picked from commit f1a0d96f41)
This commit is contained in:
Victor Stinner 2024-09-02 15:23:29 +02:00 committed by GitHub
parent b76a4a5db7
commit 10735bff9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 17 additions and 17 deletions

View file

@ -46,7 +46,7 @@ Py_LOCAL_INLINE(Py_ssize_t) _PyBytesWriter_GetSize(_PyBytesWriter *writer,
static inline PyObject* bytes_get_empty(void)
{
PyObject *empty = &EMPTY->ob_base.ob_base;
assert(_Py_IsImmortal(empty));
assert(_Py_IsImmortalLoose(empty));
return empty;
}
@ -119,7 +119,7 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size)
}
if (size == 1 && str != NULL) {
op = CHARACTER(*str & 255);
assert(_Py_IsImmortal(op));
assert(_Py_IsImmortalLoose(op));
return (PyObject *)op;
}
if (size == 0) {
@ -155,7 +155,7 @@ PyBytes_FromString(const char *str)
}
else if (size == 1) {
op = CHARACTER(*str & 255);
assert(_Py_IsImmortal(op));
assert(_Py_IsImmortalLoose(op));
return (PyObject *)op;
}