NUMPY_API * Free pointers created if As2D is called */
| 350 | * Free pointers created if As2D is called |
| 351 | */ |
| 352 | NPY_NO_EXPORT int |
| 353 | PyArray_Free(PyObject *op, void *ptr) |
| 354 | { |
| 355 | PyArrayObject *ap = (PyArrayObject *)op; |
| 356 | |
| 357 | if ((PyArray_NDIM(ap) < 1) || (PyArray_NDIM(ap) > 3)) { |
| 358 | return -1; |
| 359 | } |
| 360 | if (PyArray_NDIM(ap) >= 2) { |
| 361 | PyArray_free(ptr); |
| 362 | } |
| 363 | Py_DECREF(ap); |
| 364 | return 0; |
| 365 | } |
| 366 | |
| 367 | /* |
| 368 | * Get the ndarray subclass with the highest priority |
nothing calls this directly
no test coverage detected