diff options
author | Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> | 2024-03-19 09:20:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 09:20:38 (GMT) |
commit | a8e93d3dca086896e668b88b6c5450eaf644c0e7 (patch) | |
tree | 4de06c7d1f39d9fb7aa8b3ef8306aa73bb09ed60 /Include/cpython/code.h | |
parent | a3cf0fada09b74b1a6981cc06c4dd0bb1091b092 (diff) | |
download | cpython-a8e93d3dca086896e668b88b6c5450eaf644c0e7.zip cpython-a8e93d3dca086896e668b88b6c5450eaf644c0e7.tar.gz cpython-a8e93d3dca086896e668b88b6c5450eaf644c0e7.tar.bz2 |
gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781)
Diffstat (limited to 'Include/cpython/code.h')
-rw-r--r-- | Include/cpython/code.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 4e7e212..d5dac17 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -226,11 +226,15 @@ static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) { return op->co_nfreevars; } -static inline int PyCode_GetFirstFree(PyCodeObject *op) { +static inline int PyUnstable_Code_GetFirstFree(PyCodeObject *op) { assert(PyCode_Check(op)); return op->co_nlocalsplus - op->co_nfreevars; } +Py_DEPRECATED(3.13) static inline int PyCode_GetFirstFree(PyCodeObject *op) { + return PyUnstable_Code_GetFirstFree(op); +} + #define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive) #define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT)) |