Skip to content

Commit

Permalink
Fixed #639
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 5, 2020
1 parent f20d936 commit 5bad0d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ JSON library.
#630: Add `StreamWriteCapability` for further format-based/format-agnostic
handling improvements
#631: Add `JsonParser.getNumberValueExact()` to allow precision-retaining buffering
#639: Limit initial allocated block size by `ByteArrayBuilder` to max block size
- Deprecate `JsonParser.getCurrentTokenId()` (use `#currentTokenId()` instead)

2.11.2 (02-Aug-2020)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public final class ByteArrayBuilder extends OutputStream

public ByteArrayBuilder(BufferRecycler br, int firstBlockSize) {
_bufferRecycler = br;
// 04-Sep-2020, tatu: Let's make this bit more robust and refuse to allocate
// humongous blocks even if requested
if (firstBlockSize > MAX_BLOCK_SIZE) {
firstBlockSize = MAX_BLOCK_SIZE;
}
_currBlock = (br == null) ? new byte[firstBlockSize] : br.allocByteBuffer(BufferRecycler.BYTE_WRITE_CONCAT_BUFFER);
}

Expand Down

0 comments on commit 5bad0d4

Please sign in to comment.