From 39b924cd8ad6d6e0400cb078911647a00706ba86 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 16 May 2015 14:06:32 +0300 Subject: [PATCH] Multiset storage alignment fix --- libuavcan/include/uavcan/util/multiset.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libuavcan/include/uavcan/util/multiset.hpp b/libuavcan/include/uavcan/util/multiset.hpp index b9a9b4b07e..d796b1bff6 100644 --- a/libuavcan/include/uavcan/util/multiset.hpp +++ b/libuavcan/include/uavcan/util/multiset.hpp @@ -39,7 +39,12 @@ protected: union { unsigned char pool[sizeof(T)]; - long double _aligner1_; + /* + * Such alignment does not guarantee safety for all types (only for libuavcan internal ones); + * however, increasing it is too memory inefficient. So it is recommended to use C++11, where + * this issue is resolved with alignas() (see above). + */ + void* _aligner1_; long long _aligner2_; }; #endif