Force static flatbuffer memory to be aligned

For buffers which required lots of alignment, we were allocating more
space than needed, and manually aligning inside that space.  That
doesn't have a good enough contract to ensure that if the flatbuffer is
loaded back into RAM, it would still be aligned well enough for the
requirements.

Instead, we need to push the alignment requirement out to the allocator,
and then make sure we stay aligned inside the buffer.  The std::vector<>
allocator isn't guarenteed to be aligned, so switch everything over to
the AlignedVectorAllocator instead which is aligned.

Change-Id: Ice2aa1316914472f2a3d55f470a4dc957e2caa3c
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/flatbuffers/builder.h b/aos/flatbuffers/builder.h
index 36225c0..b4aefbe 100644
--- a/aos/flatbuffers/builder.h
+++ b/aos/flatbuffers/builder.h
@@ -18,7 +18,8 @@
 template <typename T>
 class Builder final : public ResizeableObject {
  public:
-  static constexpr size_t kBufferSize = T::kUnalignedBufferSize;
+  static constexpr size_t kBufferSize = T::kRootSize;
+  static constexpr size_t kAlign = T::kAlign;
   // Note on memory initialization: We zero-initialize all the memory that we
   // create at the start. While this can be overkill, it is simpler to manage
   // the alternatives, and we don't currently have a clear performance need for
@@ -48,7 +49,7 @@
     SetPrefix();
   }
   Builder(std::unique_ptr<Allocator> allocator =
-              std::make_unique<VectorAllocator>())
+              std::make_unique<AlignedVectorAllocator>())
       : ResizeableObject(
             allocator->AllocateOrDie(kBufferSize, T::kAlign, SetZero::kYes),
             std::move(allocator)),