Call this right before StartVector/CreateVector if you want to force the alignment to be something different than what the element size would normally dictate. This is useful when storing a nested_flatbuffer in a vector of bytes, or when storing SIMD floats, etc.
| 1762 | // This is useful when storing a nested_flatbuffer in a vector of bytes, |
| 1763 | // or when storing SIMD floats, etc. |
| 1764 | void ForceVectorAlignment(size_t len, size_t elemsize, size_t alignment) { |
| 1765 | FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); |
| 1766 | PreAlign(len * elemsize, alignment); |
| 1767 | } |
| 1768 | |
| 1769 | // Similar to ForceVectorAlignment but for String fields. |
| 1770 | void ForceStringAlignment(size_t len, size_t alignment) { |
nothing calls this directly
no test coverage detected