non-generic version of CreateUninitializedVector for c ffi
Change-Id: Id7618e53797a158b82e7e480a6507887db3528bc
This commit is contained in:
parent
ae1763e226
commit
6f4b4c80a7
|
@ -649,11 +649,15 @@ class FlatBufferBuilder FLATBUFFERS_FINAL_CLASS {
|
||||||
// Specialized version for non-copying use cases. Data to be written later.
|
// Specialized version for non-copying use cases. Data to be written later.
|
||||||
// After calling this function, GetBufferPointer() can be cast to the
|
// After calling this function, GetBufferPointer() can be cast to the
|
||||||
// corresponding Vector<> type to write the data (through Data()).
|
// corresponding Vector<> type to write the data (through Data()).
|
||||||
template<typename T> Offset<Vector<T>> CreateUninitializedVector(size_t len) {
|
uoffset_t CreateUninitializedVector(size_t len, size_t elemsize) {
|
||||||
NotNested();
|
NotNested();
|
||||||
StartVector(len, sizeof(T));
|
StartVector(len, elemsize);
|
||||||
buf_.make_space(len * sizeof(T));
|
buf_.make_space(len * elemsize);
|
||||||
return Offset<Vector<T>>(EndVector(len));
|
return EndVector(len);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T> Offset<Vector<T>> CreateUninitializedVector(size_t len) {
|
||||||
|
return CreateUninitializedVector(len, sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> Offset<Vector<T>> CreateVector(const std::vector<T> &v){
|
template<typename T> Offset<Vector<T>> CreateVector(const std::vector<T> &v){
|
||||||
|
|
Loading…
Reference in New Issue