Repository navigation
Commit 6b09207
Py_INCREF(), Py_XINCREF(), Py_DECREF() and Py_XDECREF() are now
implemented as function calls on all limited C API versions.
Previously, they were only implemented as function calls on the
limited C API version 3.12 or newer.
Previously, if a C extension was built with the limited C API version
3.11 or newer, Py_DECREF() was implemented as "op->ob_refcnt--". But
Python 3.12 made Py_DECREF() more complicated to implement immortal
objects in an efficient way. "op->ob_refcnt--" can convert an
immortal object to a mortal object which causes various kinds of
nasty bugs.
Backport to 3.15: mention the change in "Notable changes in 3.15.3"
of What's New in Python 3.15.
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
(cherry picked from commit d1e3cae)
1 parent dea81c5 commit 6b09207
3 files changed
Lines changed: 29 additions & 14 deletions
File tree
- Doc/whatsnew
- Include
- Misc/NEWS.d/next/C_API
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2952 | 2952 | | |
2953 | 2953 | | |
2954 | 2954 | | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
| |||
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
333 | 331 | | |
334 | | - | |
| 332 | + | |
335 | 333 | | |
336 | 334 | | |
337 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments