gh-127119: Faster check for small ints in long_dealloc (GH-127620)
This commit is contained in:
@@ -890,7 +890,7 @@ class PyLongObjectPtr(PyObjectPtr):
|
||||
|
||||
def proxyval(self, visited):
|
||||
'''
|
||||
Python's Include/longinterpr.h has this declaration:
|
||||
Python's Include/cpython/longinterpr.h has this declaration:
|
||||
|
||||
typedef struct _PyLongValue {
|
||||
uintptr_t lv_tag; /* Number of digits, sign and flags */
|
||||
@@ -909,8 +909,7 @@ class PyLongObjectPtr(PyObjectPtr):
|
||||
- 0: Positive
|
||||
- 1: Zero
|
||||
- 2: Negative
|
||||
The third lowest bit of lv_tag is reserved for an immortality flag, but is
|
||||
not currently used.
|
||||
The third lowest bit of lv_tag is set to 1 for the small ints and 0 otherwise.
|
||||
|
||||
where SHIFT can be either:
|
||||
#define PyLong_SHIFT 30
|
||||
|
||||
Reference in New Issue
Block a user