We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2da564 commit 7a46ca0Copy full SHA for 7a46ca0
include/eigenpy/alignment.hpp
@@ -9,6 +9,7 @@
9
#include <boost/python/converter/arg_from_python.hpp>
10
#include <boost/python/converter/rvalue_from_python_data.hpp>
11
#include <boost/type_traits/aligned_storage.hpp>
12
+#include <eigenpy/utils/is-aligned.hpp>
13
14
namespace eigenpy {
15
@@ -33,6 +34,7 @@ inline void *aligned_malloc(
33
34
std::size_t size, std::size_t alignment = EIGENPY_DEFAULT_ALIGN_BYTES) {
35
void *original = std::malloc(size + alignment);
36
if (original == 0) return 0;
37
+ if (is_aligned(original, alignment)) return original;
38
void *aligned =
39
reinterpret_cast<void *>((reinterpret_cast<std::size_t>(original) &
40
~(std::size_t(alignment - 1))) +
0 commit comments