Merged in fix/execution-trace-alignment (pull request #371)

Attempt to fix alignment error in expression factors

Approved-by: Frank Dellaert <dellaert@cc.gatech.edu>
release/4.3a0
Chris Beall 2019-01-10 22:50:33 +00:00
commit 48f586e822
2 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,7 @@ template<int T> struct CallRecord;
/// Storage type for the execution trace. /// Storage type for the execution trace.
/// It enforces the proper alignment in a portable way. /// It enforces the proper alignment in a portable way.
/// Provide a traceSize() sized array of this type to traceExecution as traceStorage. /// Provide a traceSize() sized array of this type to traceExecution as traceStorage.
static const unsigned TraceAlignment = 16; static const unsigned TraceAlignment = 32;
typedef boost::aligned_storage<1, TraceAlignment>::type ExecutionTraceStorage; typedef boost::aligned_storage<1, TraceAlignment>::type ExecutionTraceStorage;
template<bool UseBlock, typename Derived> template<bool UseBlock, typename Derived>

View File

@ -196,6 +196,7 @@ TEST(Expression, BinaryDimensions) {
TEST(Expression, BinaryTraceSize) { TEST(Expression, BinaryTraceSize) {
typedef internal::BinaryExpression<Point3, Pose3, Point3> Binary; typedef internal::BinaryExpression<Point3, Pose3, Point3> Binary;
size_t expectedTraceSize = sizeof(Binary::Record); size_t expectedTraceSize = sizeof(Binary::Record);
internal::upAlign(expectedTraceSize);
EXPECT_LONGS_EQUAL(expectedTraceSize, binary::p_cam.traceSize()); EXPECT_LONGS_EQUAL(expectedTraceSize, binary::p_cam.traceSize());
} }