Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensures that macro arguments are present in the binary reader's buffer before attempting to materialize them. #985

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

tgregg
Copy link
Contributor

@tgregg tgregg commented Oct 30, 2024

Issue #, if available:
Closes #984

Description of changes:
The top-level binary reader implementation calls fillValue() before materializing scalar values. However, the ReaderAdapterContinuable operates over the core-level reader. Therefore, it must explicitly fill the scalar values it materializes. This adapter is used by both the EExpressionArgsReader and the MacroCompiler. The fix allows the reader to read from data that is not entirely present in the buffer up-front.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment on lines +60 to +65
// Note: the following line ensures the entire container is buffered. This improves performance when reading the
// container's elements because there is less work to do per element. However, very large containers would
// increase memory usage. The current implementation already assumes this risk by eagerly materializing
// macro invocation arguments. However, if that is changed, then removing the following line should also be
// considered.
prepareValue()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context :)

@jobarr-amzn jobarr-amzn merged commit 576e018 into ion-11-encoding Oct 30, 2024
16 of 17 checks passed
@jobarr-amzn jobarr-amzn deleted the ion-11-encoding-fill-macro-args branch October 30, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants