Add note to static fbs Vector reserve() method
Change-Id: I848f6ab5f9246721e69d1baa6b64ffbed7fc189a
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/flatbuffers/static_vector.h b/aos/flatbuffers/static_vector.h
index 6133075..4ce49a7 100644
--- a/aos/flatbuffers/static_vector.h
+++ b/aos/flatbuffers/static_vector.h
@@ -291,6 +291,9 @@
// if the allocation failed for some reason.
// Note that reductions in size will not currently result in the allocated
// size actually changing.
+ // For vectors of non-inline types (e.g., vectors of strings or vectors of
+ // tables), reserve() will allocate memory in an internal vector that we use
+ // for storing some metadata.
[[nodiscard]] bool reserve(size_t new_length) {
if (new_length > allocated_length_) {
const size_t new_elements = new_length - allocated_length_;