Commit 653b6c5
committed
sysconfig, sizeof: advertise a build without the lock, and report its layout
#1236 moved `Py_GIL_DISABLED` to 0 and dropped the `t` from `sys.abiflags`,
`ABIFLAGS`, `sys.winver` and the installed stdlib directory. Restore the four
spellings and `lib/pyre3.14t`, including the cpyext include directory,
`stage-stdlib.py`, the `importing.rs` search paths and the `dist-workspace.toml`
comment naming the archived directory. The blackhole and residual-call halves of
that commit are untouched.
The object header such a build carries is four words, not two, and the
`tp_basicsize`/`tp_itemsize` projection reported the two-word layout:
- `cpython_type_layout`: the entries that grow by two words, plus `type` and
`PyWeakReference`, which grow by three.
- `cpython_type_offsets`: the `type`, `set`/`frozenset` and `memoryview`
inline offsets, and the managed weakref word, which sits two words behind
the instance rather than four.
- `str.__sizeof__`: PyASCIIObject 7 words, PyCompactUnicodeObject 9,
PyUnicodeObject 10.
- `type.__sizeof__`: PyHeapTypeObject 120 words, PyTypeObject 54.
- `object.__sizeof__`: the fallback for a type with no entry.
- `sys.getsizeof`: `_PyType_PreHeaderSize` charges no `PyGC_Head`. Without the
lock the collector keeps its bits in the object header, so a tracked
instance pays nothing for the wider header while an untracked one pays the
full two words.
- `list.__sizeof__`: `list_sort_impl` writes -1 into `allocated` while the
items are detached; clamp it rather than wrap in `size_t`.
`cpython_object_is_gc` loses its only caller and keeps the flag it reads; the
comments on it and on `flag_have_gc` no longer claim `getsizeof` adds a
collector pre-header.
`test.test_interpreters` is already recorded SKIP in `KNOWN_SKIPS` and the
baseline by #1253, whose stated reason — the package `__init__` raises
`SkipTest("GIL disabled")` when `Py_GIL_DISABLED` — holds again with the
advertisement restored.
Values measured against CPython 3.14.6 free-threaded: 22 of the 23 types the
table covers now answer the same number. `list_reverseiterator` still has no
entry and reports 32 against 48; that gap predates this change.
`test.test_str` `test_raiseMemError` was the visible failure; the rest of the
projection is reached only by `@support.cpython_only` assertions, which pyre
skips.
Assisted-by: Claude1 parent bc56455 commit 653b6c5
9 files changed
Lines changed: 126 additions & 109 deletions
File tree
- pyre
- pyre-interpreter
- include/pyre3.14t
- src
- module/sys
- pyre-object/src
- pyrex/tests
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8420 | 8420 | | |
8421 | 8421 | | |
8422 | 8422 | | |
8423 | | - | |
| 8423 | + | |
8424 | 8424 | | |
8425 | 8425 | | |
8426 | 8426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
853 | | - | |
854 | | - | |
| 852 | + | |
| 853 | + | |
855 | 854 | | |
856 | 855 | | |
857 | 856 | | |
| |||
869 | 868 | | |
870 | 869 | | |
871 | 870 | | |
872 | | - | |
| 871 | + | |
873 | 872 | | |
874 | 873 | | |
875 | 874 | | |
| |||
1087 | 1086 | | |
1088 | 1087 | | |
1089 | 1088 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1098 | 1095 | | |
1099 | 1096 | | |
1100 | 1097 | | |
| |||
1114 | 1111 | | |
1115 | 1112 | | |
1116 | 1113 | | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1122 | 1117 | | |
1123 | | - | |
| 1118 | + | |
1124 | 1119 | | |
1125 | 1120 | | |
1126 | 1121 | | |
| |||
1781 | 1776 | | |
1782 | 1777 | | |
1783 | 1778 | | |
1784 | | - | |
| 1779 | + | |
1785 | 1780 | | |
1786 | 1781 | | |
1787 | 1782 | | |
| |||
1913 | 1908 | | |
1914 | 1909 | | |
1915 | 1910 | | |
1916 | | - | |
| 1911 | + | |
1917 | 1912 | | |
1918 | 1913 | | |
1919 | 1914 | | |
| |||
1950 | 1945 | | |
1951 | 1946 | | |
1952 | 1947 | | |
1953 | | - | |
| 1948 | + | |
1954 | 1949 | | |
1955 | 1950 | | |
1956 | 1951 | | |
| |||
1959 | 1954 | | |
1960 | 1955 | | |
1961 | 1956 | | |
1962 | | - | |
| 1957 | + | |
1963 | 1958 | | |
1964 | 1959 | | |
1965 | 1960 | | |
| |||
2081 | 2076 | | |
2082 | 2077 | | |
2083 | 2078 | | |
2084 | | - | |
| 2079 | + | |
2085 | 2080 | | |
2086 | 2081 | | |
2087 | 2082 | | |
| |||
5299 | 5294 | | |
5300 | 5295 | | |
5301 | 5296 | | |
5302 | | - | |
| 5297 | + | |
5303 | 5298 | | |
5304 | 5299 | | |
5305 | 5300 | | |
5306 | 5301 | | |
5307 | | - | |
| 5302 | + | |
5308 | 5303 | | |
5309 | 5304 | | |
5310 | 5305 | | |
| |||
5322 | 5317 | | |
5323 | 5318 | | |
5324 | 5319 | | |
5325 | | - | |
| 5320 | + | |
5326 | 5321 | | |
5327 | 5322 | | |
5328 | 5323 | | |
| |||
5343 | 5338 | | |
5344 | 5339 | | |
5345 | 5340 | | |
5346 | | - | |
| 5341 | + | |
5347 | 5342 | | |
5348 | 5343 | | |
5349 | 5344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 88 | + | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
| |||
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
101 | | - | |
102 | 98 | | |
103 | 99 | | |
104 | 100 | | |
| |||
1238 | 1234 | | |
1239 | 1235 | | |
1240 | 1236 | | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
1244 | 1240 | | |
1245 | | - | |
| 1241 | + | |
1246 | 1242 | | |
1247 | 1243 | | |
1248 | 1244 | | |
| |||
2047 | 2043 | | |
2048 | 2044 | | |
2049 | 2045 | | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
2054 | | - | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
2059 | 2051 | | |
2060 | 2052 | | |
2061 | 2053 | | |
| |||
0 commit comments