mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
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:
parent
b76a4a5db7
commit
10735bff9e
7 changed files with 17 additions and 17 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue