make DefaultAllocator public and add a default constructor

This commit is contained in:
David Renshaw 2019-05-04 10:43:51 -04:00
parent 755114c1a3
commit f00f02de77

View file

@ -4,7 +4,7 @@ import java.nio.ByteBuffer;
import org.capnproto.BuilderArena.AllocationStrategy;
class DefaultAllocator implements Allocator {
public class DefaultAllocator implements Allocator {
// (minimum) number of bytes in the next allocation
private int nextSize = BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS;
@ -18,6 +18,8 @@ class DefaultAllocator implements Allocator {
public AllocationStrategy allocationStrategy =
AllocationStrategy.GROW_HEURISTICALLY;
public DefaultAllocator() {}
public DefaultAllocator(AllocationStrategy allocationStrategy) {
this.allocationStrategy = allocationStrategy;
}