-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
Codecov ReportAttention: Patch coverage is
|
1f37a0d
to
2ec377f
Compare
zlib-rs/src/allocate.rs
Outdated
@@ -160,6 +160,14 @@ impl Allocator<'static> { | |||
}; | |||
} | |||
|
|||
fn null_is_none<T>(ptr: *mut T) -> Option<*mut T> { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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.