]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-101291: Rearrange the size bits in PyLongObject (GH-102464)
authorMark Shannon <mark@hotpy.org>
Wed, 22 Mar 2023 14:49:51 +0000 (14:49 +0000)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2023 14:49:51 +0000 (14:49 +0000)
commit7559f5fda94ab568a1a910b17683ed81dc3426fb
treea050bbc075372c6246fe3386560596f2283ae8bb
parent713df2c53489ce8012d0ede10b70950e6b0d8372
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().
25 files changed:
Include/cpython/longintrepr.h
Include/internal/pycore_long.h
Include/internal/pycore_object.h
Include/internal/pycore_runtime_init.h
Include/object.h
Misc/NEWS.d/next/Core and Builtins/2023-03-06-10-02-22.gh-issue-101291.0FT2QS.rst [new file with mode: 0644]
Modules/_decimal/_decimal.c
Modules/_testcapi/mem.c
Modules/_tkinter.c
Modules/mathmodule.c
Objects/abstract.c
Objects/boolobject.c
Objects/listobject.c
Objects/longobject.c
Objects/rangeobject.c
Objects/sliceobject.c
Objects/typeobject.c
Python/ast_opt.c
Python/bltinmodule.c
Python/bytecodes.c
Python/generated_cases.c.h
Python/marshal.c
Python/specialize.c
Tools/build/deepfreeze.py
Tools/gdb/libpython.py