Ensure appropriate minimum alignment on flatbuffer tables
If you had a table whose fields all had alignments of <4 bytes, the
overall table still needed to have 4 byte alignment to account for the
various offsets included in every table.
Change-Id: I7c39c647d79dff80732f84c4e530319ee8f20c99
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/flatbuffers/static_table.h b/aos/flatbuffers/static_table.h
index f90ccde..e9619a7 100644
--- a/aos/flatbuffers/static_table.h
+++ b/aos/flatbuffers/static_table.h
@@ -43,6 +43,8 @@
}
protected:
+ static constexpr size_t kMinAlign = alignof(uoffset_t);
+
Table(std::span<uint8_t> buffer, ResizeableObject *parent)
: ResizeableObject(buffer, parent) {}
Table(std::span<uint8_t> buffer, Allocator *allocator)