Skip to content

Conversation

@antocuni
Copy link
Collaborator

@antocuni antocuni commented Aug 6, 2020

As it is written, this INCREF is spurious and causes a memory leak. See
e.g. the usage pattern in the official CPython's xxlimited.c example module:

https://github.com/python/cpython/blob/master/Modules/xxlimited.c#L262

As it is written, this INCREF is spurious and causes a memory leak. See
e.g. the usage pattern in the official CPython's xxlimited.c example module:

https://github.com/python/cpython/blob/master/Modules/xxlimited.c#L262
@antocuni
Copy link
Collaborator Author

antocuni commented Aug 6, 2020

After staring at the code more, we realized that the original idea was maybe that the INCREF was needed because ptr_ArrayType is a static global variable?
In that case this PR might be wrong, but adding a comment explaining it might help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant