mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-42064: Offset arguments for PyObject_Vectorcall in the _sqlite module (GH-27931)
This allows e.g. methods to be called efficiently by providing space for a "self" argument; see PY_VECTORCALL_ARGUMENTS_OFFSET docs.
This commit is contained in:
parent
001ef4600f
commit
01dea5f12b
2 changed files with 14 additions and 10 deletions
|
@ -462,9 +462,10 @@ error:
|
|||
static PyObject *
|
||||
get_statement_from_cache(pysqlite_Cursor *self, PyObject *operation)
|
||||
{
|
||||
PyObject *args[] = { operation, };
|
||||
PyObject *args[] = { NULL, operation, }; // Borrowed ref.
|
||||
PyObject *cache = self->connection->statement_cache;
|
||||
return PyObject_Vectorcall(cache, args, 1, NULL);
|
||||
size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
|
||||
return PyObject_Vectorcall(cache, args + 1, nargsf, NULL);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue