summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2019-01-15 06:13:27 +0100
committerMatti Picus <matti.picus@gmail.com>2019-01-15 07:13:27 +0200
commit7885b293398a5009ffc4bb961d4804b0af0b3e83 (patch)
tree3b4cd4ae7efffcda286ea85e2aad74c2f41ce35c /numpy/core/numeric.py
parent85d64e375f53f6028519d3aaad0b421934dcbe24 (diff)
downloadnumpy-7885b293398a5009ffc4bb961d4804b0af0b3e83.tar.gz
BUG: Fix reference counting for subarrays containing objects (#12650)
* BUG: Fix dtype object subarrays for INCREF/DECREF and zeros/empty init * BUG: VOID_copyswap cannot fast path nontrivial subarrays Especially object dtypes need reference counting, so cannot use memcpy. Subarrays that include fields also have data which should not be overwritten. * BUG: Copying subarrays with objects must decref original objects When not using the dtype transfer function, the buffers are initialized to NULL, and then just copied in full. Thus, at no point decref'ing happens on the data that is originally in the array. * TST: Test subarray field reference counting Tests initialization, copying and repeating (incrementing) as well as advanced indexing (uses copyswap currently) and assignment * TST: Test sparse subarray field assignments Assigning to subarray fields should not change the output in between the fields. This currently still happens for normal assignment, but not for advanced indexing. The second test is marked as `pytest.mark.valgrind_error` to make it clear that it is expected to show errors in valgrind, and give at least the theoretical the possibility to skip it during testing.
Diffstat (limited to 'numpy/core/numeric.py')
0 files changed, 0 insertions, 0 deletions