Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@scoder
Copy link
Contributor

@scoder scoder commented Jun 28, 2024

Previously, we called Py_VISIT() and Py_CLEAR() on them, which is wrong.

Probably needs backporting to 3.0.x.

Previously, we called Py_VISIT() and Py_CLEAR() on them, which is wrong.
@da-woods
Copy link
Contributor

In principle I think we should visit the memview attribute of memoryview slices (and in cdef classes too) since it does point to a reference-counted Python object that can participate in reference cycles.

With that said, I think not visiting it is better that generating invalid code, so this is definitely OK for now.

@scoder
Copy link
Contributor Author

scoder commented Jun 29, 2024

I think we should visit the memview attribute of memoryview slices

Done.

Haven't looked into cdef classes, though. Are you sure we're doing it incorrectly there?

@da-woods
Copy link
Contributor

I think we should visit the memview attribute of memoryview slices

Done.

Haven't looked into cdef classes, though. Are you sure we're doing it incorrectly there?

Yes. We're generating nothing though, rather than generating invalid code, so it isn't necessary an immediate problem.

@scoder scoder added this to the 3.1 milestone Jun 30, 2024
@scoder scoder modified the milestones: 3.1, 3.0.11 Jun 30, 2024
@scoder scoder merged commit 2cfdf70 into cython:master Jun 30, 2024
@scoder scoder deleted the fix_memslice_global_cleanup branch June 30, 2024 05:45
scoder added a commit that referenced this pull request Jun 30, 2024
Previously, we called Py_VISIT() and Py_CLEAR() on them, which is wrong.

We now correctly traverse memory view slices with Py_VISIT(memoryviewslice->memview).
@scoder
Copy link
Contributor Author

scoder commented Jun 30, 2024

3.0.x commit is 6e37bea

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.

2 participants