From d2cedc6c967f61da87c1452c4b48a93a44bab7fa Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Wed, 9 Jan 2019 17:58:52 -0800 Subject: [PATCH 1/2] attempt to fix alignment error in expression factors --- gtsam/nonlinear/internal/ExecutionTrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/nonlinear/internal/ExecutionTrace.h b/gtsam/nonlinear/internal/ExecutionTrace.h index a147f505e..ace0aaea8 100644 --- a/gtsam/nonlinear/internal/ExecutionTrace.h +++ b/gtsam/nonlinear/internal/ExecutionTrace.h @@ -35,7 +35,7 @@ template struct CallRecord; /// Storage type for the execution trace. /// It enforces the proper alignment in a portable way. /// 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; template From 704f302129da0ef17312f857541a850695f8abe0 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Thu, 10 Jan 2019 14:04:11 -0800 Subject: [PATCH 2/2] Fix testExpression --- gtsam/nonlinear/tests/testExpression.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gtsam/nonlinear/tests/testExpression.cpp b/gtsam/nonlinear/tests/testExpression.cpp index bde79e780..7a06179b4 100644 --- a/gtsam/nonlinear/tests/testExpression.cpp +++ b/gtsam/nonlinear/tests/testExpression.cpp @@ -196,6 +196,7 @@ TEST(Expression, BinaryDimensions) { TEST(Expression, BinaryTraceSize) { typedef internal::BinaryExpression Binary; size_t expectedTraceSize = sizeof(Binary::Record); + internal::upAlign(expectedTraceSize); EXPECT_LONGS_EQUAL(expectedTraceSize, binary::p_cam.traceSize()); }