Skip to content

Commit

Permalink
Merge pull request numpy#2975 from bfroehle/tp_alloc
Browse files Browse the repository at this point in the history
ENH: Use tp_basicsize, not NPY_SIZEOF_PYARRAYOBJECT, for allocation
  • Loading branch information
njsmith committed Feb 10, 2013
2 parents 3f6aaa3 + 9254542 commit 1ee8887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/arrayobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1ee8887

Please sign in to comment.