-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-103092: Ensure _ctypes.c
static types are accessed via global state
#113857
Conversation
_ctypes.c
static types are accessed via global state
@erlend-aasland, do you want to review these two PRs? |
Sure, I'll get to it later today. |
Done. I'll update this after #113620 is merged. |
_ctypes.c
static types are accessed via global state_ctypes.c
static types are accessed via global state
_ctypes.c
static types are accessed via global state_ctypes.c
static types are accessed via global state
I think this is ready for review. Sorry for mistakenly wiping out old commits (from web). Actual diff with a1ade06: --- Modules/_ctypes/_ctypes.c
+++ Modules/_ctypes/_ctypes.c
@@ -128,13 +128,6 @@
-static PyTypeObject UnionType_Type;
static PyTypeObject Union_Type;
static PyTypeObject Struct_Type;
static PyTypeObject Simple_Type;
ctypes_state global_state = {
.PyCStgDict_Type = &PyCStgDict_Type,
- .PyCStructType_Type = &PyCStructType_Type,
- .UnionType_Type = &UnionType_Type,
- .PyCPointerType_Type = &PyCPointerType_Type,
- .PyCArrayType_Type = &PyCArrayType_Type,
- .PyCSimpleType_Type = &PyCSimpleType_Type,
- .PyCFuncPtrType_Type = &PyCFuncPtrType_Type, |
Thanks, Victor! |
I merged this change which is a good start for futher work. I closed my similar duplicated (less complete) PR. |
This sets in place the
ctypes_state *st = GLOBAL_STATE()
statements to make the coming PRs smaller. Suggested by @encukou: #113630 (comment)cc @erlend-aasland