-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix interoperability with native async generators
The missing pieces were: - don't incref when unwrapping (my unconfirmed belief is that ctypes increfs automatically when you extract a field of py_object type) - call PyObject_GC_Track when wrapping The behavior is still different than in the old version that calls _PyAsyncGenValueWrapperNew directly; with that simpler call (the old approach that doesn't work on Windows due to symbol visibility), refcounts track obvious references without needing to call gc.collect(), while here it's possible for the refcount to seem over-inflated and then fix itself when a GC occurs. I haven't looked into this enough to be sure, but suspect the difference boils down to our inability to allocate from the freelist that the C allocation and deallocation functions use.
- Loading branch information
Showing
2 changed files
with
123 additions
and
116 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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