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

ParseOptions: Add ParseOptions::allocation_limit #276

Merged
merged 9 commits into from
Oct 23, 2023
Merged

Conversation

Serial-ATA
Copy link
Owner

@Serial-ATA Serial-ATA commented Oct 22, 2023

What this changes:

  • Adds ParseOptions::allocation_limit
  • Changes the default allocation limit to 16MB (previously 8MB)
  • Makes Probe::set_file_type() return Probe to support using it in a builder pattern
    • This was done to make the test nicer, and should've been the behavior from the start.
  • Improves the message for ErrorKind::TooMuchData
    • Might be worth adding a new variant specifically for exceeded allocation limits in the future. The other contexts where it is used don't necessarily apply to allocation.

The allocation limit can simply be set once and retained for the rest of the program's runtime.

closes #274
closes #208

@Serial-ATA Serial-ATA merged commit 776c7da into main Oct 23, 2023
12 checks passed
@Serial-ATA Serial-ATA deleted the alloc-limits branch October 23, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant