Add FlatbufferFixedAllocatorArray::CopyFrom
This is handy for copying the contents of a flatbuffer around quickly.
Change-Id: Ied5e0c24775e89ae5346bdf62980b785d6c1b291
diff --git a/aos/flatbuffers.cc b/aos/flatbuffers.cc
index 06d11f4..4f6497e 100644
--- a/aos/flatbuffers.cc
+++ b/aos/flatbuffers.cc
@@ -4,11 +4,12 @@
namespace aos {
-uint8_t *FixedAllocatorBase::allocate(size_t) {
+uint8_t *FixedAllocatorBase::allocate(size_t allocated_size) {
if (is_allocated_) {
LOG(FATAL) << "Can't allocate more memory with a fixed size allocator. "
"Increase the memory reserved.";
}
+ CHECK_LE(allocated_size, size());
is_allocated_ = true;
return data();