Fixed possible alignment issue in Go

Java patch with same purpose:
cdb0dca39d

Change-Id: I57d268cc0064843779eb7812a9e69326d9ab2498
Tested: on Darwin
This commit is contained in:
rw
2014-09-03 23:26:06 -07:00
committed by Wouter van Oortmerssen
parent 11f2538610
commit 417cb878c3
4 changed files with 43 additions and 19 deletions

View File

@@ -231,9 +231,10 @@ func (b *Builder) PrependUOffsetT(off UOffsetT) {
// A vector has the following format:
// <UOffsetT: number of elements in this vector>
// <T: data>+, where T is the type of elements of this vector.
func (b *Builder) StartVector(elemSize, numElems int) UOffsetT {
func (b *Builder) StartVector(elemSize, numElems, alignment int) UOffsetT {
b.notNested()
b.Prep(SizeUint32, elemSize*numElems)
b.Prep(alignment, elemSize*numElems) // Just in case alignment > int.
return b.Offset()
}