mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)
Co-authored-by: Andrew Frost <adfrost@fb.com> Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
This commit is contained in:
parent
e37ac5fbb6
commit
a41ed975e8
9 changed files with 115 additions and 3 deletions
|
@ -134,6 +134,9 @@ uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func)
|
|||
if (func->func_version != 0) {
|
||||
return func->func_version;
|
||||
}
|
||||
if (func->vectorcall != _PyFunction_Vectorcall) {
|
||||
return 0;
|
||||
}
|
||||
if (next_func_version == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -209,6 +212,14 @@ PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
PyFunction_SetVectorcall(PyFunctionObject *func, vectorcallfunc vectorcall)
|
||||
{
|
||||
assert(func != NULL);
|
||||
func->func_version = 0;
|
||||
func->vectorcall = vectorcall;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
PyFunction_GetKwDefaults(PyObject *op)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue