Skip to content

Commit 267e1c8

Browse files
committed
Round up to the next power of 2 for flatbuffer builder allocations
1 parent b634136 commit 267e1c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ impl PythonBindGenerator {
10961096
}
10971097

10981098
if self.has_complex_pack {
1099-
self.write_str(" let size = flat_t.get_size();");
1099+
self.write_str(" let size = flat_t.get_size().next_power_of_two();");
11001100
self.write_str("");
11011101
self.write_str(" let mut builder = FlatBufferBuilder::with_capacity(size);");
11021102
self.write_str(" let offset = flat_t.pack(&mut builder);");

0 commit comments

Comments
 (0)