Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Dealloc cached buffer info (#12249) #12296

Merged
merged 1 commit into from
Oct 31, 2018

Conversation

charris
Copy link
Member

@charris charris commented Oct 31, 2018

Backport of #12249.

Fixes #12122.

577dbbd, added in 2009 for numpy 1.5 to fix TRAC issue 1312 worked around a deficiency in that "PyArg_ParseTuple("s#", ...) refuses to return a buffer if bf_releasebuffer is present". That changeset never released a buffer_info_cache entry for a scalar. This fixes that problem. Note also cpython issue 24009 where they discuss deprecating "s#" parsing.

It is difficult to test this fix since the cache keys are id(value) and the cache is static in buffer.c. We should revisit the need for the cache, it seems like there should be a better way.

Edit: note that the issue number predates github, formatting

  • BUG: clear buffer_info_cache on scalar dealloc

  • MAINT: preemptively call _array_dealloc_buffer_info as soon as possible

  • BUG: also remove cached info for scalars

  • MAINT: refactor _array_dealloc_buffer_info-> _dealloc_cached_buffer_info

* BUG: clear buffer_info_cache on scalar dealloc

* MAINT: preemptively call _array_dealloc_buffer_info as soon as possible

* BUG: also remove cached info for scalars

* MAINT: refactor _array_dealloc_buffer_info-> _dealloc_cached_buffer_info
@charris charris added this to the 1.15.4 release milestone Oct 31, 2018
@charris charris merged commit bbcb714 into numpy:maintenance/1.15.x Oct 31, 2018
@charris charris deleted the backport-12249 branch October 31, 2018 14:48
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.

None yet

2 participants