Skip to content

Commit bbe408b

Browse files
committed
Increase max largest alignment size to 64 byte
Because Apache Arrow wants to reuse this with 64 byte alignment.
1 parent c15920a commit bbe408b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/flatbuffers/alignable.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ module FlatBuffers
1818
using AppendAsBytes if const_defined?(:AppendAsBytes)
1919

2020
module Alignable
21-
LARGEST_ALIGNMENT_SIZE = 8 # IO::Buffer.size_of(:u64)
22-
LARGEST_PADDING = "\x00" * 7
21+
# Apache Arrow suggests 64 byte alignment.
22+
LARGEST_ALIGNMENT_SIZE = 64
23+
LARGEST_PADDING = "\x00" * (LARGEST_ALIGNMENT_SIZE - 1)
2324

2425
private
2526
def compute_padding_size(size, alignment_byte)

0 commit comments

Comments
 (0)