On Thu, Jun 13, 2019 at 10:37 PM Victor Stinner <vstin...@redhat.com> 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. https://docs.microsoft.com/en-us/cpp/cpp/dllexport-dllimport?view=vs-2019 It seems dllexport doesn't affect to calling convention. https://clang.llvm.org/docs/LTOVisibility.html https://devblogs.microsoft.com/oldnewthing/?p=2123 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. Regards, -- Inada Naoki <songofaca...@gmail.com> _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/VMFW7Y4LHHNYMQRR4UMCMV4X54CBMSQI/