MCPcopy Create free account
hub / github.com/numpy/numpy / PyArray_Free

Function PyArray_Free

numpy/core/src/multiarray/multiarraymodule.c:352–365  ·  view source on GitHub ↗

NUMPY_API * Free pointers created if As2D is called */

Source from the content-addressed store, hash-verified

350 * Free pointers created if As2D is called
351 */
352NPY_NO_EXPORT int
353PyArray_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

Callers

nothing calls this directly

Calls 1

PyArray_NDIMFunction · 0.85

Tested by

no test coverage detected