Skip to content

Commit 683b77c

Browse files
committed
core: check data alignment
1 parent 0deef65 commit 683b77c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/eigenpy/eigen-allocator.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ struct EigenAllocator {
124124
PyArrayObject *pyArray,
125125
boost::python::converter::rvalue_from_python_storage<MatType> *storage) {
126126
void *raw_ptr = storage->storage.bytes;
127+
assert(is_aligned(raw_ptr, EIGENPY_DEFAULT_ALIGN_BYTES) &&
128+
"The pointer is not aligned.");
129+
127130
Type *mat_ptr = details::init_matrix_or_array<Type>::run(pyArray, raw_ptr);
128131
Type &mat = *mat_ptr;
129132

0 commit comments

Comments
 (0)