]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102304: Fix 2 New Stable ABI Functions (gh-104762)
authorEric Snow <ericsnowcurrently@gmail.com>
Tue, 30 May 2023 22:40:07 +0000 (16:40 -0600)
committerGitHub <noreply@github.com>
Tue, 30 May 2023 22:40:07 +0000 (22:40 +0000)
Include/object.h
Lib/test/test_stable_abi_ctypes.py
Misc/stable_abi.toml
PC/python3dll.c

index c4fe2f83ef62bccced308d1c758f7e33e4dccc89..c2fee85a2c38f6a48809fdb25f7b0fa08d22eda1 100644 (file)
@@ -590,7 +590,7 @@ you can count such references to the type object.)
 extern Py_ssize_t _Py_RefTotal;
 #    define _Py_INC_REFTOTAL() _Py_RefTotal++
 #    define _Py_DEC_REFTOTAL() _Py_RefTotal--
-#  elif !defined(Py_LIMITED_API) || Py_LIMITED_API+0 > 0x030D0000
+#  elif !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
 PyAPI_FUNC(void) _Py_IncRefTotal_DO_NOT_USE_THIS(void);
 PyAPI_FUNC(void) _Py_DecRefTotal_DO_NOT_USE_THIS(void);
 #    define _Py_INC_REFTOTAL() _Py_IncRefTotal_DO_NOT_USE_THIS()
index 4ca39d85e5460c938c3dadf6df3a557491460869..60ad3603ae92233c145cb98d01502c95f0a5255c 100644 (file)
@@ -918,6 +918,8 @@ if feature_macros['PY_HAVE_THREAD_NATIVE_ID']:
     )
 if feature_macros['Py_REF_DEBUG']:
     SYMBOL_NAMES += (
+        '_Py_DecRefTotal_DO_NOT_USE_THIS',
+        '_Py_IncRefTotal_DO_NOT_USE_THIS',
         '_Py_NegativeRefcount',
         '_Py_RefTotal',
     )
index 48299e9b35ff973b6fcc50ab1ba31f96976c46b1..1db98483f09f770a69cfd163b811ceaee843dd21 100644 (file)
     added = '3.12'
 [const.Py_TPFLAGS_ITEMS_AT_END]
     added = '3.12'
+
+[function._Py_IncRefTotal_DO_NOT_USE_THIS]
+    added = '3.12'
+    ifdef = 'Py_REF_DEBUG'
+    abi_only = true
+[function._Py_DecRefTotal_DO_NOT_USE_THIS]
+    added = '3.12'
+    ifdef = 'Py_REF_DEBUG'
+    abi_only = true
index 7e848abccfd1fa6484c13d7ac328492ee154819e..f2c0d9dee883d9936d82d1ee073fc794bdf4d8d8 100755 (executable)
@@ -18,7 +18,9 @@ EXPORT_FUNC(_Py_BuildValue_SizeT)
 EXPORT_FUNC(_Py_CheckRecursiveCall)
 EXPORT_FUNC(_Py_Dealloc)
 EXPORT_FUNC(_Py_DecRef)
+EXPORT_FUNC(_Py_DecRefTotal_DO_NOT_USE_THIS)
 EXPORT_FUNC(_Py_IncRef)
+EXPORT_FUNC(_Py_IncRefTotal_DO_NOT_USE_THIS)
 EXPORT_FUNC(_Py_NegativeRefcount)
 EXPORT_FUNC(_Py_VaBuildValue_SizeT)
 EXPORT_FUNC(_PyArg_Parse_SizeT)