mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-04 11:17:38 +00:00
Fixed possible alignment issue in Java
Tested: on Linux Change-Id: Ie80aa19ed13ac4fa15cd3fd768f1a35526bdc607
This commit is contained in:
parent
f2908b7787
commit
cdb0dca39d
3 changed files with 18 additions and 10 deletions
|
|
@ -320,8 +320,12 @@ static void GenStruct(StructDef &struct_def,
|
|||
code += " public static void start" + MakeCamel(field.name);
|
||||
code += "Vector(FlatBufferBuilder builder, int numElems) ";
|
||||
code += "{ builder.startVector(";
|
||||
code += NumToString(InlineSize(field.value.type.VectorType()));
|
||||
code += ", numElems); }\n";
|
||||
auto vector_type = field.value.type.VectorType();
|
||||
auto alignment = InlineAlignment(vector_type);
|
||||
auto elem_size = InlineSize(vector_type);
|
||||
code += NumToString(elem_size);
|
||||
code += ", numElems, " + NumToString(alignment);
|
||||
code += "); }\n";
|
||||
}
|
||||
}
|
||||
code += " public static int end" + struct_def.name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue