summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-02-09 15:55:27 +0100
committerSebastian Berg <sebastianb@nvidia.com>2023-02-19 19:52:05 +0100
commit6eaf10b2197461ada988d3aa7a2a86f6b3f9f7ab (patch)
treea36f42bf83ad3c2e16101fc10c56c5138061523b /numpy/core/src
parent65340d930d1e58c5f8a10a892a2aa03ca54400e0 (diff)
downloadnumpy-6eaf10b2197461ada988d3aa7a2a86f6b3f9f7ab.tar.gz
DOC: Add code comment about why flags are not used in refcount.c
We simply don't bother releasing the GIL right now. This could make sense in principle for some user dtypes, though. (NumPy only ever uses clearing with Python objects so the GIL is always needed). I see no plausible use of checking floating point errors, so do not bother to add such cruft, if anyone ever needs it, they should add it.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/multiarray/refcount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c
index 8c2399610..e735e3b8f 100644
--- a/numpy/core/src/multiarray/refcount.c
+++ b/numpy/core/src/multiarray/refcount.c
@@ -44,9 +44,10 @@ PyArray_ClearBuffer(
}
NPY_traverse_info clear_info;
- NPY_ARRAYMETHOD_FLAGS flags;
+ /* Flags unused: float errors do not matter and we do not release GIL */
+ NPY_ARRAYMETHOD_FLAGS flags_unused;
if (PyArray_GetClearFunction(
- aligned, stride, descr, &clear_info, &flags) < 0) {
+ aligned, stride, descr, &clear_info, &flags_unused) < 0) {
return -1;
}
@@ -96,9 +97,10 @@ PyArray_ClearBuffer(
npy_intp inner_stride = strides_it[0];
npy_intp inner_shape = shape_it[0];
NPY_traverse_info clear_info;
- NPY_ARRAYMETHOD_FLAGS flags;
+ /* Flags unused: float errors do not matter and we do not release GIL */
+ NPY_ARRAYMETHOD_FLAGS flags_unused;
if (PyArray_GetClearFunction(
- aligned, inner_stride, descr, &clear_info, &flags) < 0) {
+ aligned, inner_stride, descr, &clear_info, &flags_unused) < 0) {
return -1;
}
NPY_RAW_ITER_START(idim, ndim, coord, shape_it) {