GeezerVison is showing github.com — gh-114314: Move types to ctypes_state by vstinner · Pull Request #114316 · python/cpython
Conversation
vstinner
commented
Jan 19, 2024
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Move types to the ctypes_state structure:
- PyCArray_Type
- PyCData_Type
- PyCFuncPtr_Type
- PyCPointer_Type
- Simple_Type
The following macros get an additional state parameter:
- ArrayObject_Check()
- CDataObject_Check()
- CDataObject_CheckExact()
- PointerObject_Check()
- PyCFuncPtrObject_Check()
The following function gets an additional state parameter:
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Move types to the ctypes_state structure:
* PyCArray_Type
* PyCData_Type
* PyCFuncPtr_Type
* PyCPointer_Type
* Simple_Type
The following macros get an additional state parameter:
* ArrayObject_Check()
* CDataObject_Check()
* CDataObject_CheckExact()
* PointerObject_Check()
* PyCFuncPtrObject_Check()
The following function gets an additional state parameter:
* _PyCData_set()
Co-Authored-By: neonene <[email protected]>
|
This change only prepares the code to convert static types to heap types. It doesn't change the behavior.
It only moves references to types from global variables to the _ctypes state and pass the state to macros and functions using it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
To keep this change as small as possible, I didn't change the following macros to add a new state parameter.
#define PyCSimpleTypeObject_CheckExact(v) Py_IS_TYPE(v, GLOBAL_STATE()->PyCSimpleType_Type)
#define PyCSimpleTypeObject_Check(v) PyObject_TypeCheck(v, GLOBAL_STATE()->PyCSimpleType_Type)
#define PyCArrayTypeObject_Check(v) PyObject_TypeCheck(v, GLOBAL_STATE()->PyCArrayType_Type)
#define PyCPointerTypeObject_Check(v) PyObject_TypeCheck(v, GLOBAL_STATE()->PyCPointerType_Type)
#define PyCFuncPtrTypeObject_Check(v) PyObject_TypeCheck(v, GLOBAL_STATE()->PyCFuncPtrType_Type)
#define PyCStructTypeObject_Check(v) PyObject_TypeCheck(v, GLOBAL_STATE()->PyCStructType_Type)
These macros can be changed afterwards.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
PR #113857, which expects fewer follow-up PRs, can be closed after this is landed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|