]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424) (GH-119468)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 30 May 2024 09:24:42 +0000 (11:24 +0200)
committerGitHub <noreply@github.com>
Thu, 30 May 2024 09:24:42 +0000 (11:24 +0200)
commit322e0ad3dec0068224657ea550ddbaac96d44648
treec19eadea119f824ccc2de73413e9cad78df1bcc6
parentd1c7f5ed08a7f92afeb760c32e33d6d49dd1ad5b
[3.13] gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424) (GH-119468)

gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424)

Add a funciton that inlines PyObject_GetTypeData and skips
type-checking, so it doesn't need access to the CType_Type object.
This will break if the memory layout changes, but should
be an acceptable solution to enable ctypes in subinterpreters in
Python 3.13.

Mark _ctypes as safe for multiple interpreters

(cherry picked from commit a192547dfe7c4f184cc8b579c3eff2f61f642483)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Modules/_ctypes/_ctypes.c
Modules/_ctypes/ctypes.h