| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bae415a commit 92022d8
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -343,6 +343,15 @@ Build Changes | |||
| 343 | 343 | :file:`!configure`. | |
| 344 | 344 | (Contributed by Christian Heimes in :gh:`89886`.) | |
| 345 | 345 | ||
| 346 | + * C extensions built with the :ref:`limited C API <limited-c-api>` | ||
| 347 | + on :ref:`Python build in debug mode <debug-build>` no longer support Python | ||
| 348 | + 3.9 and older. In this configuration, :c:func:`Py_INCREF` and | ||
| 349 | + :c:func:`Py_DECREF` are now always implemented as opaque function calls, | ||
| 350 | + but the called functions were added to Python 3.10. Build C extensions | ||
| 351 | + with a release build of Python or with Python 3.12 and older, to keep support | ||
| 352 | + for Python 3.9 and older. | ||
| 353 | + (Contributed by Victor Stinner in :gh:`102304`.) | ||
| 354 | + | ||
| 346 | 355 | ||
| 347 | 356 | C API Changes | |
| 348 | 357 | ============= | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -585,20 +585,14 @@ decision that's up to the implementer of each new type so if you want, | |||
| 585 | 585 | you can count such references to the type object.) | |
| 586 | 586 | */ | |
| 587 | 587 | ||
| 588 | - #ifdef Py_REF_DEBUG | ||
| 589 | - # if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030A0000 | ||
| 590 | - extern Py_ssize_t _Py_RefTotal; | ||
| 591 | - # define _Py_INC_REFTOTAL() _Py_RefTotal++ | ||
| 592 | - # define _Py_DEC_REFTOTAL() _Py_RefTotal-- | ||
| 593 | - # elif !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000 | ||
| 588 | + #if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API) | ||
| 589 | + PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno, | ||
| 590 | + PyObject *op); | ||
| 594 | 591 | PyAPI_FUNC(void) _Py_IncRefTotal_DO_NOT_USE_THIS(void); | |
| 595 | 592 | PyAPI_FUNC(void) _Py_DecRefTotal_DO_NOT_USE_THIS(void); | |
| 596 | 593 | # define _Py_INC_REFTOTAL() _Py_IncRefTotal_DO_NOT_USE_THIS() | |
| 597 | 594 | # define _Py_DEC_REFTOTAL() _Py_DecRefTotal_DO_NOT_USE_THIS() | |
| 598 | - # endif | ||
| 599 | - PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno, | ||
| 600 | - PyObject *op); | ||
| 601 | - #endif /* Py_REF_DEBUG */ | ||
| 595 | + #endif // Py_REF_DEBUG && !Py_LIMITED_API | ||
| 602 | 596 | ||
| 603 | 597 | PyAPI_FUNC(void) _Py_Dealloc(PyObject *); | |
| 604 | 598 | ||
@@ -616,8 +610,8 @@ PyAPI_FUNC(void) _Py_DecRef(PyObject *); | |||
| 616 | 610 | ||
| 617 | 611 | static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op) | |
| 618 | 612 | { | |
| 619 | - #if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000 | ||
| 620 | - // Stable ABI for Python 3.10 built in debug mode. | ||
| 613 | + #if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) | ||
| 614 | + // Stable ABI for Python built in debug mode | ||
| 621 | 615 | _Py_IncRef(op); | |
| 622 | 616 | #else | |
| 623 | 617 | // Non-limited C API and limited C API for Python 3.9 and older access | |
@@ -647,8 +641,8 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op) | |||
| 647 | 641 | # define Py_INCREF(op) Py_INCREF(_PyObject_CAST(op)) | |
| 648 | 642 | #endif | |
| 649 | 643 | ||
| 650 | - #if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000 | ||
| 651 | - // Stable ABI for limited C API version 3.10 of Python debug build | ||
| 644 | + #if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) | ||
| 645 | + // Stable ABI for Python built in debug mode | ||
| 652 | 646 | static inline void Py_DECREF(PyObject *op) { | |
| 653 | 647 | _Py_DecRef(op); | |
| 654 | 648 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2428,12 +2428,3 @@ | |||
| 2428 | 2428 | added = '3.12' | |
| 2429 | 2429 | [const.Py_TPFLAGS_ITEMS_AT_END] | |
| 2430 | 2430 | added = '3.12' | |
| 2431 | - | ||
| 2432 | - [function._Py_IncRefTotal_DO_NOT_USE_THIS] | ||
| 2433 | - added = '3.12' | ||
| 2434 | - ifdef = 'Py_REF_DEBUG' | ||
| 2435 | - abi_only = true | ||
| 2436 | - [function._Py_DecRefTotal_DO_NOT_USE_THIS] | ||
| 2437 | - added = '3.12' | ||
| 2438 | - ifdef = 'Py_REF_DEBUG' | ||
| 2439 | - abi_only = true | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments