Commit 4235a256 authored by shassani's avatar shassani Committed by Wouter van Oortmerssen

Adds ForceStringAlignment to flatbuffers. (#4828)

ForceStringAlignment is useful for memory aligning string fields in flatbuffers.
parent 88cd1823
......@@ -1206,6 +1206,11 @@ class FlatBufferBuilder {
void ForceVectorAlignment(size_t len, size_t elemsize, size_t alignment) {
PreAlign(len * elemsize, alignment);
}
// Similar to ForceVectorAlignment but for String fields.
void ForceStringAlignment(size_t len, size_t alignment) {
PreAlign((len + 1) * sizeof(char), alignment);
}
/// @endcond
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment