diff options
author | Ken Jin <kenjin@python.org> | 2023-04-30 13:08:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-30 13:08:26 (GMT) |
commit | ed95e8cbd4cbc813666c7ce7760257cc0f169d03 (patch) | |
tree | 55929b3092e83753baa34eac09f63666d072d286 /Objects/call.c | |
parent | accb417c338630ac6e836a5c811a89d54a3cd1d3 (diff) | |
download | cpython-ed95e8cbd4cbc813666c7ce7760257cc0f169d03.zip cpython-ed95e8cbd4cbc813666c7ce7760257cc0f169d03.tar.gz cpython-ed95e8cbd4cbc813666c7ce7760257cc0f169d03.tar.bz2 |
gh-98003: Inline call frames for CALL_FUNCTION_EX (GH-98004)
Diffstat (limited to 'Objects/call.c')
-rw-r--r-- | Objects/call.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Objects/call.c b/Objects/call.c index bd027e4..cf6e357 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -8,16 +8,6 @@ #include "pycore_tuple.h" // _PyTuple_ITEMS() -static PyObject *const * -_PyStack_UnpackDict(PyThreadState *tstate, - PyObject *const *args, Py_ssize_t nargs, - PyObject *kwargs, PyObject **p_kwnames); - -static void -_PyStack_UnpackDict_Free(PyObject *const *stack, Py_ssize_t nargs, - PyObject *kwnames); - - static PyObject * null_error(PyThreadState *tstate) { @@ -965,7 +955,7 @@ _PyStack_AsDict(PyObject *const *values, PyObject *kwnames) The newly allocated argument vector supports PY_VECTORCALL_ARGUMENTS_OFFSET. When done, you must call _PyStack_UnpackDict_Free(stack, nargs, kwnames) */ -static PyObject *const * +PyObject *const * _PyStack_UnpackDict(PyThreadState *tstate, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs, PyObject **p_kwnames) @@ -1034,7 +1024,7 @@ _PyStack_UnpackDict(PyThreadState *tstate, return stack; } -static void +void _PyStack_UnpackDict_Free(PyObject *const *stack, Py_ssize_t nargs, PyObject *kwnames) { @@ -1042,6 +1032,12 @@ _PyStack_UnpackDict_Free(PyObject *const *stack, Py_ssize_t nargs, for (Py_ssize_t i = 0; i < n; i++) { Py_DECREF(stack[i]); } + _PyStack_UnpackDict_FreeNoDecRef(stack, kwnames); +} + +void +_PyStack_UnpackDict_FreeNoDecRef(PyObject *const *stack, PyObject *kwnames) +{ PyMem_Free((PyObject **)stack - 1); Py_DECREF(kwnames); } |