Skip to content

Commit

Permalink
Use _Py_CAST()
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Nov 16, 2023
1 parent 7d64093 commit 4a34e88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ having all the lower 32 bits set, which will avoid the reference count to go
beyond the refcount limit. Immortality checks for reference count decreases will
be done by checking the bit sign flag in the lower 32 bits.
*/
#define _Py_IMMORTAL_REFCNT (Py_ssize_t)UINT_MAX
#define _Py_IMMORTAL_REFCNT _Py_CAST(Py_ssize_t, UINT_MAX)

#else
/*
Expand All @@ -103,7 +103,7 @@ immortality, but the execution would still be correct.
Reference count increases and decreases will first go through an immortality
check by comparing the reference count field to the immortality reference count.
*/
#define _Py_IMMORTAL_REFCNT (Py_ssize_t)(UINT_MAX >> 2)
#define _Py_IMMORTAL_REFCNT _Py_CAST(Py_ssize_t, UINT_MAX >> 2)
#endif

// Py_NOGIL builds indicate immortal objects using `ob_ref_local`, which is
Expand Down

0 comments on commit 4a34e88

Please sign in to comment.