Skip to content

Simplify deflate window #272

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

Merged
merged 6 commits into from
Jan 6, 2025
Merged

Simplify deflate window #272

merged 6 commits into from
Jan 6, 2025

Conversation

folkertdev
Copy link
Collaborator

this will conflict with #271, but should be simple to fix.

We really don't need this fine-grained initialization: just zero the whole thing out at the start (via the allocator if possible) and get rid of a bunch of bookkeeping.

@folkertdev folkertdev requested a review from bjorn3 December 23, 2024 16:05
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 95.91837% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
zlib-rs/src/deflate.rs 92.85% 1 Missing ⚠️
zlib-rs/src/inflate.rs 80.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
zlib-rs/src/allocate.rs 98.67% <100.00%> (+0.23%) ⬆️
zlib-rs/src/deflate/pending.rs 97.01% <100.00%> (ø)
zlib-rs/src/deflate/window.rs 97.77% <100.00%> (+7.58%) ⬆️
zlib-rs/src/inflate/window.rs 97.95% <100.00%> (+0.38%) ⬆️
zlib-rs/src/read_buf.rs 90.47% <100.00%> (-0.83%) ⬇️
zlib-rs/src/deflate.rs 96.76% <92.85%> (-0.08%) ⬇️
zlib-rs/src/inflate.rs 91.05% <80.00%> (ø)

... and 2 files with indirect coverage changes

@folkertdev folkertdev force-pushed the simplify-deflate-window branch from 1f37a0d to 2ec377f Compare December 23, 2024 16:06
@@ -160,6 +160,14 @@ impl Allocator<'static> {
};
}

fn null_is_none<T>(ptr: *mut T) -> Option<*mut T> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to return Option<NonNull<T>> instead? Then it would just be a NonNull::new() to get the Option and the return value is half as big.

Copy link
Collaborator

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

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

with out without the NonNull change.

@folkertdev folkertdev merged commit f085060 into main Jan 6, 2025
20 checks passed
@folkertdev folkertdev deleted the simplify-deflate-window branch January 6, 2025 21:29
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