Commit cb35d3a0 authored by Morten Grouleff's avatar Morten Grouleff Committed by Wouter van Oortmerssen

Use all of the available space in the buffer returned by ByteBufferFactory to…

Use all of the available space in the buffer returned by ByteBufferFactory to allow the factory to keep a pool of larger than initialsize sized buffers. (#5500)
parent 8e6cabb3
......@@ -72,7 +72,6 @@ public class FlatBufferBuilder {
if (initial_size <= 0) {
initial_size = 1;
}
space = initial_size;
this.bb_factory = bb_factory;
if (existing_bb != null) {
bb = existing_bb;
......@@ -82,6 +81,7 @@ public class FlatBufferBuilder {
bb = bb_factory.newByteBuffer(initial_size);
}
this.utf8 = utf8;
space = bb.capacity();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment