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)

This commit is contained in:
Morten Grouleff
2019-09-03 20:13:32 +02:00
committed by Wouter van Oortmerssen
parent 8e6cabb31b
commit cb35d3a0e5

View File

@@ -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();
}
/**