* Check if self has memory overlap with one of the index arrays, or with extra_op. * * @returns 1 if memory overlap found, 0 if not. */
| 744 | * @returns 1 if memory overlap found, 0 if not. |
| 745 | */ |
| 746 | NPY_NO_EXPORT int |
| 747 | index_has_memory_overlap(PyArrayObject *self, |
| 748 | int index_type, npy_index_info *indices, int num, |
| 749 | PyObject *extra_op) |
| 750 | { |
| 751 | int i; |
| 752 | |
| 753 | if (index_type & (HAS_FANCY | HAS_BOOL)) { |
| 754 | for (i = 0; i < num; ++i) { |
| 755 | if (indices[i].object != NULL && |
| 756 | PyArray_Check(indices[i].object) && |
| 757 | solve_may_share_memory(self, |
| 758 | (PyArrayObject *)indices[i].object, |
| 759 | 1) != 0) { |
| 760 | return 1; |
| 761 | } |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | if (extra_op != NULL && PyArray_Check(extra_op) && |
| 766 | solve_may_share_memory(self, (PyArrayObject *)extra_op, 1) != 0) { |
| 767 | return 1; |
| 768 | } |
| 769 | |
| 770 | return 0; |
| 771 | } |
| 772 | |
| 773 | |
| 774 | /** |
no test coverage detected