Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-103092: Ensure_ctypes.c
static types are accessed via global state#113857
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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. |
Uh oh!
There was an error while loading.Please reload this page.
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 stateI think this is ready for review. Sorry for mistakenly wiping out old commits (from web). Actual diff witha1ade06: --- 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, |
Uh oh!
There was an error while loading.Please reload this page.
Thanks, Victor! |
I merged this change which is a good start for futher work. I closed my similar duplicated (less complete) PR. |
Uh oh!
There was an error while loading.Please reload this page.
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