SIGN IN SIGN UP

[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>
M
Miss Islington (bot) committed
322e0ad3dec0068224657ea550ddbaac96d44648
Parent: d1c7f5e
Committed by GitHub <noreply@github.com> on 5/30/2024, 9:24:42 AM