Lukasz Anforowicz

Results 105 comments of Lukasz Anforowicz

@rustbot label -pr-waiting-on-author +pr-follow-up-review-pending

@ytmimi - this PR should be ready for another review pass please. In addition to resolving the PR feedback above I also did some other minor changes: - When resolving...

FWIW I've attempted to address this by switching to naive safe code (using `vec.resize(capacity, 0)` to fill the spare capacity with zeros). See the PR here: https://github.com/rust-lang/flate2-rs/pull/373 Going via `&mut...

> If you are creating a vector from scratch, using `vec![0; capacity]` is faster than `vec.resize(capacity, 0)` because it requests already-zeroed memory from the OS. Ack. Here (e.g. in `compress_vec`)...

> The approach of writing to the spare capacity without zeroing it first sounds good, provided that the C library wrappers are adjusted to write to a `&mut [MaybeUninit]`. Yes,...

Using `MaybeUninit` requires changing the public API of https://docs.rs/flate2/latest/flate2/struct.Compress.html, right? I see two options: * Option1: Add a new `pub fn compress_uninit(..., output: &mut [MaybeUninit], ...)` * Option2: Change the...

Let me try to summarize the options we have identified so far (focusing on `compress_vec` but the notes should also carry over to `decompress_vec`): * Fix1: Avoid `unsafe`. - One...

> If calls to `compress_vec` and `decompress_vec` are uncommon, then I'd rather make them slightly slower through zero-initialization than remove these functions outright. Ack. Both Fix1 and Fix3 are easy...

/cc @Byron Can you please provide your feedback on this issue? Which of the fix options discussed above would you prefer? (e.g. out of the ones in https://github.com/rust-lang/flate2-rs/issues/220#issuecomment-1699804151) It may...

Any plans for releasing a new version of the crate? (if so, then it would be greatly appraciated as it would help me get approval to import the crate into...