-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
gh-91049: Introduce set vectorcall field API for PyFunctionObject #92257
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
Changes from 1 commit
9cf96ec
282e3dc
edcdcf1
debf5a9
473d18d
76e8c9d
3337459
1543f44
08082bd
ed93327
24ffd30
89cb4b2
3387d4a
b0cc28a
99e4085
24353c8
60f7769
376ee75
56ffc70
5340e87
a5e9d13
12faf52
6623470
9149f14
e732d7e
84874fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -87,6 +87,7 @@ There are a few functions specific to Python functions. | |||||
|
||||||
Set the vectorcall field of a given function object *func* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
.. versionadded:: 3.12 | ||||||
|
||||||
.. c:function:: PyObject* PyFunction_GetClosure(PyObject *op) | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -237,7 +237,9 @@ New Features | |||||
(Contributed by Wenzel Jakob in :gh:`93012`.) | ||||||
|
||||||
* Add new function :c:func:`PyFunction_SetVectorcall` to the C API | ||||||
which sets the vectorcall field of a given PyFunctionObject | ||||||
which sets the vectorcall field of a given :c:type:`PyFunctionObject` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Warning: extensions using this API must preserve the behavior | ||||||
of the unaltered function! | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that this document is the right place to put a warning. Why this warning is not in the documentation of the function? |
||||||
(Contributed by Andrew Frost in :gh:`92257`.) | ||||||
|
||||||
Porting to Python 3.12 | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,5 @@ | ||||||
CPython extensions providing optimized execution of Python bytecode (like Cinder JIT and Pyjion) | ||||||
can benefit from being able to modify the vectorcall field on instances of PyFunctionObject to allow calling the optimized path (e.g. JIT-compiled) directly. | ||||||
Add new function :c:func:`PyFunction_SetVectorcall` to the C API | ||||||
which sets the vectorcall field of a given :c:type:`PyFunctionObject` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
This PR introduces an API call where vectorcall field can be modified like so: | ||||||
|
||||||
`void PyFunction_SetVectorcall(PyFunctionObject *func, vectorcallfunc vectorcall);` | ||||||
Warning: extensions using this API must preserve the behavior | ||||||
of the unaltered function! | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this warning. |
Uh oh!
There was an error while loading. Please reload this page.