Repository navigation
Allocate Snappy stream buffers from the effective block size - #769
Open
curforever wants to merge 1 commit into
Open
curforever wants to merge 1 commit into
curforever wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #173.
SnappyOutputStreamclamps its effective block size toMIN_BLOCK_SIZE, but allocates both buffers using the original constructor argument. For small requested sizes, bulk and primitive-array writes use the larger effective size and can exceed the allocated input buffer; negative values fail allocation despite the existing clamp.Size both buffers from
this.blockSize, preserving the existing minimum normalization, upper limit and stream format. No native code or build configuration changes.Validation on Windows x86_64 / Microsoft OpenJDK21 / upstream sbt2.0.10, keeping the original
--release8target:testFullwith temporaryset exportJars := false: 166 passing, 1 original/default skipped, zero failures/errors.scalafmtCheckAll,packageand JAR integration pass. Integration uses the unchanged upstreamSnappyIntegrationTest.java, with Windows classpath separation and an E-local temporary directory.The original-default Windows test invocation failed before tests because the OSGi plugin could not replace a JAR in use. sbt2 defaults
exportJarsto true; the test runs use its documented command-line opt-out to compiled class directories. For the class-directory full suite, original main resources were temporarily merged into the class output so the existing isolated-CodeSource loader test could find them. Those exact owned copies were removed before the standalonepackage, which uses the unchanged defaults and is followed by the actual JAR integration test. The intermediate class/resource isolation failure is retained in the logs; no test was disabled. No skip flags, exclusions or dependency/build-file changes were added. The bundled Windows native library was exercised; other OS/JDK matrix cells and native rebuilds were not run locally. No performance result is claimed.Prepared with assistance from OpenAI Codex; the validation commands above were run locally.