Commit 7146ff15 authored by Joseph Weston's avatar Joseph Weston
Browse files

fix reported array basicsize

this fixes object size calculation. The previous implementation
did not work in cases where the datatype stored in the tinyarray
is narrower than a machine word, and the compiler padded
'Array_base' to be word-aligned.
parent 53710aa5
......@@ -1799,7 +1799,7 @@ template <typename T>
PyTypeObject Array<T>::pytype = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
pyname,
sizeof(Array<T>) - sizeof(T), // tp_basicsize
sizeof(Array_base), // tp_basicsize
sizeof(T), // tp_itemsize
(destructor)PyObject_Del, // tp_dealloc
0, // tp_print
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment