In the Python API, when using load_chunk() to a preallocated buffer, the buffer is checked for being contiguous.
The calculations happen on the basis of the record component's datatype, not on the datatype of the buffer (the datatype of the buffer cannot be queried on a py::buffer object, just the item size).
If the datatypes are mismatched, the error message is very confusing (and in fact wrong): [Record_Component::load_chunk()] Requires contiguous slab of memory.
This checks if the item size matches the datatype before doing and check for contiguous data.
In the Python API, when using
load_chunk()
to a preallocated buffer, the buffer is checked for being contiguous. The calculations happen on the basis of the record component's datatype, not on the datatype of the buffer (the datatype of the buffer cannot be queried on apy::buffer
object, just the item size). If the datatypes are mismatched, the error message is very confusing (and in fact wrong):[Record_Component::load_chunk()] Requires contiguous slab of memory.
This checks if the item size matches the datatype before doing and check for contiguous data.