On Thu, Jun 13, 2019 at 10:37 PM Victor Stinner firstname.lastname@example.org wrote:
Python 3.8 now has a better separation between "private" and "internal" APIs:
- private are "_Py" symbols which are exported in the python DLL: they
should not be used, but can be used techically
- internal are symbols defined in internal header files
(Include/internal/). Some symbols use PyAPI_FUNC()/PyAPI_DATA(), some only use "extern".
Thank you for clarifying. I confused always about it.
I'm in favor of moving towards "extern" for new internal APIs. I'm trying to keep PyAPI_FUNC/PyAPI_DATA to export symbols in DLL for things which might be useful for 3rd party tools like debuggers or profilers.
Hmm, debugger or profiler need this? I thought only loaders and DLL explorers use this.
Currently, many private APIs uses `PyAPI_FUNC()`.
Well, that's mostly for historical reasons :-)
OK, I see.
Is there any downside about having much unnecessary exported functions?
The main risk is that people start to use it, expect these APIs to be there forever, and might be surprised that their code fail with the newer Python.
I know, and I agree with both of you and Jeroen.
But I concern about performance, stack memory usage, and binary size. By quick googling, I find some answers.
It seems dllexport doesn't affect to calling convention.
It seems dllexport affects linker. At least, linker can not remove dllexport-ed function even if the function is not called anywhere in the DLL.