Stop stripping the size prefix off
This turns out to be super dangerous to do. A flatbuffer is aligned
assuming that the size is either there or not there. By removing it,
you break alignment.
This necesitates having 2 subclasses of Flatbuffer. A SizePrefixed
version and a non size prefixed version. That lets us distinguish for
methods which care.
Once all that's done, deal with the fallout through the code base,
including logfile_utils and the chaos that causes rippling out.
Change-Id: I91b7be355279a1c19e5c956c33359df01a17eacf
diff --git a/aos/events/logging/logger.h b/aos/events/logging/logger.h
index b37fea2..f6a037b 100644
--- a/aos/events/logging/logger.h
+++ b/aos/events/logging/logger.h
@@ -454,7 +454,7 @@
// This is *a* log file header used to provide the logged config. The rest of
// the header is likely distracting.
- FlatbufferVector<LogFileHeader> log_file_header_;
+ SizePrefixedFlatbufferVector<LogFileHeader> log_file_header_;
// Returns [ta; tb; ...] = tuple[0] * t + tuple[1]
std::tuple<Eigen::Matrix<double, Eigen::Dynamic, 1>,
@@ -472,7 +472,7 @@
// update_time (will be) set to true when popping this message causes the
// filter to change the time offset estimation function.
std::tuple<TimestampMerger::DeliveryTimestamp, int,
- FlatbufferVector<MessageHeader>>
+ SizePrefixedFlatbufferVector<MessageHeader>>
PopOldest(bool *update_time);
// Returns the monotonic time of the oldest message.
@@ -614,7 +614,7 @@
std::unique_ptr<ChannelMerger> channel_merger_;
std::deque<std::tuple<TimestampMerger::DeliveryTimestamp, int,
- FlatbufferVector<MessageHeader>,
+ SizePrefixedFlatbufferVector<MessageHeader>,
message_bridge::NoncausalOffsetEstimator *>>
sorted_messages_;