mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781)
This commit is contained in:
parent
a3cf0fada0
commit
a8e93d3dca
8 changed files with 23 additions and 6 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue