diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2021-04-19 19:20:50 -0500 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2021-04-20 17:36:28 -0500 |
commit | b2926034b6056e42525ad702b380339940755124 (patch) | |
tree | da98a8a240843e635a394c9ab063219b6c4fade1 /numpy/array_api/tests | |
parent | bb2a1ad9161838212ac90af4f6d6af430bbab00d (diff) | |
download | numpy-b2926034b6056e42525ad702b380339940755124.tar.gz |
MAINT: Remove buffer-clearing from copy code
Buffer must always either contain NULL or valid references
(assuming the dtype supports references) in order to allow
cleanup in case of errors.
It is thus unnecessary to clear buffers before every copy, if
they contain NULL, all is fine. If they contain non-NULL, we should
also DECREF those references (so it would be incorrect as well).
Buffers thus need the memset exactly once: directly upon allcoation
(which we do now). After this any transfer from/to the buffer needs
to ensure that the buffer is always in a good state.
Diffstat (limited to 'numpy/array_api/tests')
0 files changed, 0 insertions, 0 deletions