From 3c60400daebb295173516e68e72486a131c53630 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Sun, 17 Mar 2019 21:11:49 -0400 Subject: [PATCH] make SUGGESTED_FIRST_SEGMENT_WORDS the default --- runtime/src/main/java/org/capnproto/DefaultAllocator.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/src/main/java/org/capnproto/DefaultAllocator.java b/runtime/src/main/java/org/capnproto/DefaultAllocator.java index 58b9932..72cd344 100644 --- a/runtime/src/main/java/org/capnproto/DefaultAllocator.java +++ b/runtime/src/main/java/org/capnproto/DefaultAllocator.java @@ -7,7 +7,7 @@ import org.capnproto.BuilderArena.AllocationStrategy; class DefaultAllocator implements Allocator { // (minimum) number of bytes in the next allocation - private int nextSize = 0; + private int nextSize = BuilderArena.SUGGESTED_FIRST_SEGMENT_WORDS; public enum ByteBufferAllocationStyle { REGULAR, @@ -53,9 +53,6 @@ class DefaultAllocator implements Allocator { this.nextSize += size; break; case FIXED_SIZE: - if (nextSize == 0) { - nextSize = size; - } break; }