| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
There are a few more structseq types:
|
Sorry, something went wrong.
Sorry, something went wrong.
|
I changed my mind and also enabled the code on Python release build. Previously, I only enabled the code if the Py_DEBUG macro was defined. For example, the Windows CI job on pull requests builds Python in release mode. If something is wrong, I prefer to catch the bug early and fix it. |
Sorry, something went wrong.
Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc() functions to finalize a structseq static type in Py_Finalize(). Currrently, these functions do nothing if Python is built in release mode. Clear static types: * AsyncGenHooksType: sys.set_asyncgen_hooks() * FlagsType: sys.flags * FloatInfoType: sys.float_info * Hash_InfoType: sys.hash_info * Int_InfoType: sys.int_info * ThreadInfoType: sys.thread_info * UnraisableHookArgsType: sys.unraisablehook * VersionInfoType: sys.version * WindowsVersionType: sys.getwindowsversion()
|
The PR is now ready for a review :-) |
Sorry, something went wrong.
There was a problem hiding this comment.
OK. This PR looks good to me :)
But I think another question: Can we add a global cache to maintain the StructSequenceType and don't call the dealloc function in finalize_interp_types() manually?
Sorry, something went wrong.
Do you mean to create a list of structseq types when _PyStructSequence_InitType() or _PyStructSequence_InitType2() is called? Yeah, I had this idea, but I am not sure about it. A problem is to control exactly when these types are deleted and types them in a specific order. The Python finalization is quite complex, see my notes about past issues: https://pythondev.readthedocs.io/finalization.html assert(Py_REFCNT(type) == 1); of _PyStructSequence_FiniType() fails if something still keeps the a reference to the type somewhere: if the type is deallocated "too early". |
Sorry, something went wrong.
Yes. That's what I mean : )
OK, Thanks for your information. I will study your notes. |
Sorry, something went wrong.
I added tests. Would you mind to review these tests as well? |
Sorry, something went wrong.
|
I enhanced the tests to check more PyTypeObject members. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc()
functions to finalize a structseq static type in Py_Finalize().
Currrently, these functions do nothing if Python is built in release
mode.
Clear static types:
https://bugs.python.org/issue46417