STINNER Victor <vstin...@redhat.com> added the comment:

> Is it guarantied that static inline functions will be inlined and will be not 
> called as external functions from the Python library? The latter would break 
> binary compatibility of extensions compiled with newer Python headers with 
> older binary Python libraries.

Ok, I made more checks. In short, PR 10079 has no impact on the ABI 
compatibility.


I modified Py_STATIC_INLINE() to remove __attribute__((always_inline)).

In this case, the ./python binary contains multiple "instances" (what's the 
correct name for that?) of the "_Py_INCREF" inline function:
---
vstinner@apu$ readelf -sW ./python | c++filt -t |grep -E '(INC|DEC)REF'
    42: 000000000041f908    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
    43: 000000000041f939   121 FUNC    LOCAL  DEFAULT   13 _Py_DECREF
   109: 00000000004234cb    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
   ...
  5639: a486d    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
  5786: a7abc    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
  5801: a7f0f    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
  ...
  8126: 00000000006011c5    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
  8127: 00000000006011f6   121 FUNC    LOCAL  DEFAULT   13 _Py_DECREF
  8140: 0000000000601971    49 FUNC    LOCAL  DEFAULT   13 _Py_INCREF
  8141: 00000000006019a2   121 FUNC    LOCAL  DEFAULT   13 _Py_DECREF
  ...
---

These functions are *LOCAL*, I understand that they are not exported.


I also checked the _struct module:

vstinner@apu$ readelf -sW 
build/lib.linux-x86_64-3.8-pydebug/_struct.cpython-38dm-x86_64-linux-gnu.so | 
c++filt -t |grep -E '(INC|DEC)REF'
    40: 0000000000002e99    55 FUNC    LOCAL  DEFAULT   11 _Py_INCREF
    41: 0000000000002ed0   127 FUNC    LOCAL  DEFAULT   11 _Py_DECREF

Again, these functions are "LOCAL", not imported nor exported.

I undertand that _struct.so doesn't depend on libpython for INCREF/DECREF: it 
contains its own "implementation".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35059>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

  • ... STINNER Victor
  • ... Aaron Hall
  • ... Benjamin Peterson
  • ... STINNER Victor
  • ... శ్రీనివాస్ రెడ్డి తాటిపర్తి
  • ... STINNER Victor
  • ... STINNER Victor
  • ... STINNER Victor
  • ... Serhiy Storchaka
  • ... STINNER Victor
  • ... STINNER Victor
  • ... STINNER Victor
  • ... STINNER Victor
  • ... STINNER Victor
  • ... STINNER Victor
  • ... Benjamin Peterson
  • ... STINNER Victor
    • ... Benjamin Peterson
  • ... STINNER Victor
  • ... STINNER Victor
  • ... STINNER Victor

Reply via email to