diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/multiarray/arrayobject.c | 2 | ||||
| -rw-r--r-- | numpy/core/src/multiarray/item_selection.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c index 10b750cdb..b559d4aba 100644 --- a/numpy/core/src/multiarray/arrayobject.c +++ b/numpy/core/src/multiarray/arrayobject.c @@ -1655,7 +1655,7 @@ array_alloc(PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems)) { PyObject *obj; /* nitems will always be 0 */ - obj = (PyObject *)PyArray_malloc(NPY_SIZEOF_PYARRAYOBJECT); + obj = (PyObject *)PyArray_malloc(type->tp_basicsize); PyObject_Init(obj, type); return obj; } diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c index 0da921b62..31916cf40 100644 --- a/numpy/core/src/multiarray/item_selection.c +++ b/numpy/core/src/multiarray/item_selection.c @@ -1225,11 +1225,11 @@ PyArray_LexSort(PyObject *sort_keys, int axis) "need sequence of keys with len > 0 in lexsort"); return NULL; } - mps = (PyArrayObject **) PyArray_malloc(n*NPY_SIZEOF_PYARRAYOBJECT); + mps = (PyArrayObject **) PyArray_malloc(n * sizeof(PyArrayObject *)); if (mps == NULL) { return PyErr_NoMemory(); } - its = (PyArrayIterObject **) PyArray_malloc(n*sizeof(PyArrayIterObject)); + its = (PyArrayIterObject **) PyArray_malloc(n * sizeof(PyArrayIterObject *)); if (its == NULL) { PyArray_free(mps); return PyErr_NoMemory(); |
