classification
Title: Export symbols for vectorcall
Type: Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: David Hewitt, petr.viktorin
Priority: normal Keywords:

Created on 2020-02-27 08:08 by David Hewitt, last changed 2020-03-04 07:25 by David Hewitt. This issue is now closed.

Messages (3)
msg362789 - (view) Author: David Hewitt (David Hewitt) Date: 2020-02-27 08:08
I have been looking into using vectorcall in [pyo3](https://github.com/PyO3/pyo3) (Rust bindings to Python) against python3.8.

It looks like the _PyObject_Vectorcall symbols are not included in the shared library. I've checked both Windows and Linux.

I think the `static inline` definition of `PyObject_Vectorcall` and related functions in `abstract.h` means that they won't be exported as symbols in the final library?
msg363271 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-03-03 16:10
Yes. Can you use PyObject_Call instead (or one of the non-Vectorcall variants listed in https://docs.python.org/3.9/c-api/call.html#object-calling-api )

Vectorcall is mainly a speed optimization over PyObject_Call. We want to allow the C compiler to inline PyObject_Vectorcall whenever it is used.
That can be done with static functions or macros, which does unfortunately mean that the symbol is not exported.
msg363332 - (view) Author: David Hewitt (David Hewitt) Date: 2020-03-04 07:25
I had suspected that might be the case. We already use PyObject_Call but had been hoping to experiment with the Vectorcall optimizations.

Without the symbols I might resort to reproducing the implementation of these functions on the Rust side. Shouldn't be too much code duplication.
History
Date User Action Args
2020-03-04 07:25:02David Hewittsetstatus: open -> closed
resolution: rejected
messages: + msg363332

stage: resolved
2020-03-03 16:10:58petr.viktorinsetmessages: + msg363271
2020-02-27 09:06:01xtreaksetnosy: + petr.viktorin
2020-02-27 08:08:41David Hewittcreate