Move away from APIs that use borrowed references under the free-threaded build by hugovk · Pull Request #8216 · python-pillow/Pillow
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Let's merge this.
hugovk
deleted the
free-threading
branch
pythoncapi_compat.h has been added in it's entirety, but if I'm reading this right, we're only using PyList_GetItemRef() and PyDict_GetItemRef().
Was the entire file added just for simplicity, or do you expect that other functions will be used in the future as well?
I thought about only including what we use, but added the whole thing for simplicity. It also makes updating it easier, and we might use more in the future.
I'm not against using a minimal file, but then again, does it affect compiled executable size (at all or significantly)? (I'm on a plane waiting to take off so can't test right now :)
The file is currently 1103 bytes, so I don't consider size to be a problem. I just wanted to clarify the rationale.
does it affect compiled executable size (at all or significantly)
They appear to all be static inline functions, so as far as I understand (I also checked GCC on godbolt.org), only those functions that we actually use should be included in the compiled executable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters