Skip to content

gh-98586: add whatsnew entry covering limited-API outgoing vector calls, related documentation fix #99056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/c-api/call.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ This is a pointer to a function with the following signature:
and they must be unique.
If there are no keyword arguments, then *kwnames* can instead be *NULL*.

.. c:macro:: PY_VECTORCALL_ARGUMENTS_OFFSET
.. data:: PY_VECTORCALL_ARGUMENTS_OFFSET

If this flag is set in a vectorcall *nargsf* argument, the callee is allowed
to temporarily change ``args[-1]``. In other words, *args* points to
Expand Down
12 changes: 12 additions & 0 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,18 @@ New Features
``__dict__`` and weakrefs with less bookkeeping,
using less memory and with faster access.

* API for performing calls using
:ref:`the vectorcall protocol <vectorcall>` was added to the
:ref:`Limited API <stable>`:

* :c:func:`PyObject_Vectorcall`
* :c:func:`PyObject_VectorcallMethod`
* :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`

This means that both the incoming and outgoing ends of the vector call
protocol are now available in the :ref:`Limited API <stable>`. (Contributed
by Wenzel Jakob in :gh:`98586`.)

* Added two new public functions,
:c:func:`PyEval_SetProfileAllThreads` and
:c:func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Added the methods :c:func:`PyObject_Vectorcall` and
:c:func:`PyObject_VectorcallMethod` to the :ref:`Limited API <stable>` along
with the auxiliary macro constant :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`.
with the auxiliary macro constant :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`.

The availability of these functions enables more efficient :PEP:`590` vector
calls from binary extension modules that avoid argument boxing/unboxing
Expand Down