mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Fixed possible alignment issue in Go
Java patch with same purpose:
cdb0dca39d
Change-Id: I57d268cc0064843779eb7812a9e69326d9ab2498
Tested: on Darwin
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
11f2538610
commit
417cb878c3
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user