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

Rust: Limit preallocation during byte (opaque, string) reads to 1kb #178

Closed
wants to merge 6 commits into from

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Oct 28, 2023

What

In the Rust generated code limit preallocation during byte (opaque, string) reads to 1kb.

Why

Close #174

@leighmcculloch leighmcculloch marked this pull request as ready for review October 28, 2023 06:53
Comment on lines +6 to +7
#[cfg(feature = "std")]
const MAX_PREALLOCATED_BYTES_READ: usize = 1024; // 1KB
Copy link
Member Author

Choose a reason for hiding this comment

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

Would be nice to make this configurable. But would rather set it to a sensible limit at this point and revisit that when it matters.

Copy link
Contributor

@graydon graydon left a comment

Choose a reason for hiding this comment

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

One minor nit otherwise looks great

lib/xdrgen/generators/rust/src/types.rs Outdated Show resolved Hide resolved
@leighmcculloch
Copy link
Member Author

leighmcculloch commented Oct 31, 2023

Alternative implementation that I believe solves the same problem is proposed in #179.

@leighmcculloch
Copy link
Member Author

Closing in favor of #179.

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.

Rust: Remove preallocation in vararray / varopaque conversions
4 participants