]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424)
authorPetr Viktorin <encukou@gmail.com>
Thu, 23 May 2024 16:01:37 +0000 (18:01 +0200)
committerGitHub <noreply@github.com>
Thu, 23 May 2024 16:01:37 +0000 (16:01 +0000)
commita192547dfe7c4f184cc8b579c3eff2f61f642483
tree7b4be0bb65f11de657662bce0d58bf15104cb41b
parent406ffb5293a8c9ca315bf63de1ee36a9b33f9aaf
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

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