-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-114314: ctypes: remove stgdict and switch to heap types #116458
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
6155211
Move paramfunc into a new struct, PyStgInfo
encukou 0171c30
Move the StgInfo out of StgDictObject and into the classes themselves
encukou acd91e9
Move StgInfo init/retrieval right after the corresponding StgDict one
encukou 55af504
Move `size` from StgDict to StgInfo
encukou 27e5c50
Move `align` from StgDict to StgInfo
encukou 01bc637
Move `length` from StgDict to StgInfo, except for sizeof calculation
encukou c8017e9
Move part of the sizeof calculation
encukou 40b012f
Move `ffi_type_pointer` from StgDict to StgInfo
encukou 537defb
Move `proto` from StgDict to StgInfo. Doesn't work just yet.
encukou ace6623
Hack: Reserve space for StgInfo in static type objects
encukou 6f775b9
If StgInfo is not initialized, act as if it's not there
encukou 4aaa06a
Move `getfunc` & `setfunc`
encukou 6808524
Move `argtypes`
encukou f031c00
Move `converters`
encukou 535176c
Move `restype`
encukou 5260003
Move `checker`
encukou 0d3017e
Move `flags`
encukou 269b825
Move `format`
encukou 946f474
Move `ndim`
encukou 607ed23
Move `shape`
encukou cb126b7
Replace more uses of StgDict
encukou fd04c91
Don't pass dicts to PyCStgDict_clone
encukou 8dce549
Don't set StgDict as type dict; use name `attrdict` for the type __di…
encukou 6705e0e
Remove more uses of StgDict
encukou 8f99377
Remove StgDict
encukou daea3e5
Remove StgDict from comments, names, and platform-specific code
encukou f67211f
Switch PyCSimpleType_new to _init
encukou 02aa9e1
Switch _SimpleCData to a heap type
encukou 13feac7
Convert Struct and Union type _new to _init
encukou a68417b
Switch PyCPointerType_new to _init
encukou ad5d7b4
Switch PyCFuncPtrType_new to _init
encukou 8d5e230
Switch CFuncPtr to heap type
encukou cdfae13
Switch Array to heap type
encukou 2d80960
Switch _Pointer to a heap type
encukou 3337ba4
Switch _ctypes.Union to heap type
encukou 596cb89
Switch Structure to heap type
encukou 91feb64
Make the type-adding macros more regular
encukou 77c64fe
Switch _CData to a heap type
encukou 0be46a1
Visit/decref type in PyCData visit/dealloc
encukou 9be3520
Remove _HackyHeapType
encukou e523c2f
Decref attrdicts
encukou fb70e43
Delegate CType_Type deallocation to PyType_Type.tp_dealloc
encukou cc59dea
Fix Windows-specific crashes
neonene 9bd9eb1
Update comments
encukou 946a0b1
Add tests for metaclass details
encukou 970b41d
Fix getting the module state
encukou 2a450ad
Add a blurb, even though this *should* not affect usage
encukou 9878809
Apply suggestions from code review
encukou b2ba89a
Inline PyStgInfo_From* & PyStgInfo_Init for performance
encukou 605c30c
Make CType_Type's clear & dealloc safer
encukou 41dea1b
Remove self decrefs in error cases in init functions
encukou be0888f
Add `static` to PyType_Spec
encukou ac6eb38
Remove redundant comment
encukou 33be37f
Apply suggestions from code review
encukou 0b9d0a7
Fix comment
encukou f02bad6
PyErr_WriteUnraisable clears the exception
encukou 16faac7
Call tp_init for argument validation
encukou 2461e50
Add test for swapped type creation
neonene ab90768
Merge branch 'main' into ctypes-no-stgdict
encukou de054af
Fix test_swapped_type_creation
encukou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Call tp_init for argument validation
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.