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:38 UTC

[avro] branch avro-3657-initial-buffer-size created (now 99b0e1176)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a change to branch avro-3657-initial-buffer-size
in repository https://gitbox.apache.org/repos/asf/avro.git


      at 99b0e1176 AVRO-3657: Computation of initial buffer size in OutputBuffer makes no sense

This branch includes the following new commits:

     new 99b0e1176 AVRO-3657: Computation of initial buffer size in OutputBuffer makes no sense

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[avro] 01/01: AVRO-3657: Computation of initial buffer size in OutputBuffer makes no sense

Posted by mg...@apache.org.
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() {