mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
GH-101291: Rearrange the size bits in PyLongObject (GH-102464)
* Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts. * Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints. * Add functions to hide some internals of long object, and for setting sign and digit count. * Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
This commit is contained in:
parent
713df2c534
commit
7559f5fda9
25 changed files with 982 additions and 898 deletions
|
|
@ -137,8 +137,9 @@ static inline void
|
|||
_PyObject_InitVar(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size)
|
||||
{
|
||||
assert(op != NULL);
|
||||
Py_SET_SIZE(op, size);
|
||||
assert(typeobj != &PyLong_Type);
|
||||
_PyObject_Init((PyObject *)op, typeobj);
|
||||
Py_SET_SIZE(op, size);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue