FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-103092: Ensure `_ctypes.c` static types are accessed via global state by neonene · Pull Request #113857 · python/cpython · GitHub

/ cpython Public

gh-103092: Ensure _ctypes.c static types are accessed via global state - #113857

Merged
vstinner merged 5 commits into
python:mainfrom
neonene:ctypes_ready
Jan 22, 2024
Merged

gh-103092: Ensure _ctypes.c static types are accessed via global state#113857
vstinner merged 5 commits into
python:mainfrom
neonene:ctypes_ready

Conversation

neonene commented Jan 9, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

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

bedevere-app Bot mentioned this pull request Jan 9, 2024
25 tasks
neonene changed the title gh-103092: Ensure '_ctypes.c' static types are accessed via global state gh-103092: Ensure _ctypes.c static types are accessed via global state Jan 9, 2024

Copy link
Copy Markdown
Contributor

See also ongoing work by @aisk in #113620. Perhaps you could coordinate your efforts?

encukou commented Jan 10, 2024

Copy link
Copy Markdown
Member

@erlend-aasland, do you want to review these two PRs?
If you merge one I'll be happy to resolve the conflicts on the other one.

Copy link
Copy Markdown
Contributor

@erlend-aasland, do you want to review these two PRs? If you merge one I'll be happy to resolve the conflicts on the other one.

Sure, I'll get to it later today.

erlend-aasland self-assigned this Jan 10, 2024
Comment thread Modules/_ctypes/callbacks.c Outdated

neonene commented Jan 17, 2024

Copy link
Copy Markdown
Contributor Author

Done. I'll update this after #113620 is merged.

neonene closed this Jan 18, 2024
neonene changed the title gh-103092: Ensure _ctypes.c static types are accessed via global state Ensure _ctypes.c static types are accessed via global state Jan 18, 2024
neonene reopened this Jan 18, 2024
neonene changed the title Ensure _ctypes.c static types are accessed via global state gh-103092: Ensure _ctypes.c static types are accessed via global state Jan 18, 2024

neonene commented Jan 18, 2024

Copy link
Copy Markdown
Contributor Author

I think this is ready for review. Sorry for mistakenly wiping out old commits (from web).

Actual diff with a1ade06:

Details
--- 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,

Comment thread Modules/_ctypes/ctypes.h

Copy link
Copy Markdown
Contributor

Thanks, Victor!

Copy link
Copy Markdown
Member

I merged this change which is a good start for futher work. I closed my similar duplicated (less complete) PR.

neonene deleted the ctypes_ready branch January 22, 2024 17:49
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL