You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/11/14 08:45:39 UTC
[avro] 01/01: AVRO-3657: Computation of initial buffer size in OutputBuffer makes no sense
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch avro-3657-initial-buffer-size
in repository https://gitbox.apache.org/repos/asf/avro.git
commit 99b0e11769062026f344ec0747aecca8bd6cb5af
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Nov 14 10:44:44 2022 +0200
AVRO-3657: Computation of initial buffer size in OutputBuffer makes no sense
Allocate 1.25x more space than the block size
Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
lang/java/trevni/core/src/main/java/org/apache/trevni/OutputBuffer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lang/java/trevni/core/src/main/java/org/apache/trevni/OutputBuffer.java b/lang/java/trevni/core/src/main/java/org/apache/trevni/OutputBuffer.java
index 74413b431..55419aed3 100644
--- a/lang/java/trevni/core/src/main/java/org/apache/trevni/OutputBuffer.java
+++ b/lang/java/trevni/core/src/main/java/org/apache/trevni/OutputBuffer.java
@@ -30,7 +30,7 @@ class OutputBuffer extends ByteArrayOutputStream {
private int bitCount; // position in booleans
public OutputBuffer() {
- super((BLOCK_SIZE + BLOCK_SIZE) >> 2);
+ super(BLOCK_SIZE + (BLOCK_SIZE >> 2));
}
public boolean isFull() {