summaryrefslogtreecommitdiff
path: root/numpy/array_api/_elementwise_functions.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-11-26 14:43:58 -0600
committerGitHub <noreply@github.com>2020-11-26 13:43:58 -0700
commitaf4b110273346e5969fba04365bc477747529fe2 (patch)
tree66d192f2ea9b56521716bc5cab0f48dd89f1a248 /numpy/array_api/_elementwise_functions.py
parentd4ba8edb36eb8f272274d835294533eb00b0e57a (diff)
downloadnumpy-af4b110273346e5969fba04365bc477747529fe2.tar.gz
ENH,API: Store exported buffer info on the array (#16938)
* ENH,API: Store exported buffer info on the array This speeds up array deallocation and buffer exports, since it removes the need to global dictionary lookups. It also somewhat simplifies the logic. The main advantage is prossibly less the speedup itself (which is not large compared to most things that happen in the livetime of an array), but rather that no unnecessary work is done for shortlived arrays, which never export a buffer. The downside of this approach is that the ABI changes for anyone who would be subclassing ndarray in C. * MAINT: Do not tag the NULL (no buffers exported) The allocation is not the right place to initialize to anything but NULL, so take the easy path and do not tag the NULL default. * TST: Add test for best try RuntimeError on corrupt buffer-info * Remove NPY_SIZEOF_PYARRAYOBJECT and add some documentation * Use 3 to tag the pointer and object for a "bad" one in the test * DEP: deprecate the NPY_SIZEOF_PYARRAYOBJECT macro * Tune down matti's deprecation to write the error instead. * Tweak macro, so that clang hopefully doesn't complain. * Use None instead of NULL in PyErr_WriteUnraisable, pypy seems to have a bug with it * Just comment it out... * Apply suggestions from code review Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: mattip <matti.picus@gmail.com>
Diffstat (limited to 'numpy/array_api/_elementwise_functions.py')
0 files changed, 0 insertions, 0 deletions