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

We are missing 4 bytes in the LZ4 compression buffer. #1226

Merged
merged 1 commit into from
Dec 2, 2021
Merged

Conversation

fulmicoton
Copy link
Collaborator

Closes #831

@codecov-commenter
Copy link

Codecov Report

Merging #1226 (1aecb4e) into main (f378d9a) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1226      +/-   ##
==========================================
+ Coverage   94.10%   94.12%   +0.02%     
==========================================
  Files         205      205              
  Lines       34453    34452       -1     
==========================================
+ Hits        32421    32428       +7     
+ Misses       2032     2024       -8     
Impacted Files Coverage Δ
src/store/compression_lz4_block.rs 89.47% <100.00%> (-0.27%) ⬇️
src/tokenizer/stemmer.rs 63.63% <0.00%> (-1.82%) ⬇️
src/directory/watch_event_router.rs 96.15% <0.00%> (-0.77%) ⬇️
src/query/union.rs 99.39% <0.00%> (+0.60%) ⬆️
src/indexer/segment_updater.rs 95.34% <0.00%> (+1.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f378d9a...1aecb4e. Read the comment docs.

Copy link
Contributor

@PSeitz PSeitz left a comment

Choose a reason for hiding this comment

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

The 4 bytes are already included in get_maximum_output_size, but let's not rely on that

@fulmicoton
Copy link
Collaborator Author

The 4 bytes are already included in get_maximum_output_size, but let's not rely on that

The previous code was creating a slice with unallocated memory. (in addition to being uninitialized)

@PSeitz
Copy link
Contributor

PSeitz commented Dec 2, 2021

The previous code was creating a slice with unallocated memory. (in addition to being uninitialized)

With the reserve call, it should be allocated?
Uninitialized data is being handled in lz4_flex via MaybeUninit.

@fulmicoton
Copy link
Collaborator Author

@PSeitz Now it is allocated. Before this PR, the last 4 bytes were not necessarily allocated.
If you know how to deal with the MaybeUninitialized thing that would be awesome to remove the allow clippy thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants