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

Decode into an uninitialized byte slice #63

Merged
merged 4 commits into from
Dec 30, 2024
Merged

Conversation

gatesn
Copy link
Contributor

@gatesn gatesn commented Dec 30, 2024

Fixes #61

@gatesn gatesn requested a review from lwwmanning December 30, 2024 18:47
@gatesn gatesn enabled auto-merge (squash) December 30, 2024 19:11
src/lib.rs Outdated
Comment on lines 255 to 257
pub fn decompressed_capacity(&self, compressed: &[u8]) -> usize {
size_of::<Symbol>() * (compressed.len() + 1)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should call this max_decompression_capacity. it's an upper-bound since symbols need not be 8 bytes (and most of them time they'll be <= 3bytes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep fair, although the check is that the slice must be == this capacity. We could make it <=, but would require a bounds check inside each iteration which feels... slow

@gatesn gatesn merged commit 11eec59 into develop Dec 30, 2024
3 checks passed
@gatesn gatesn deleted the ngates/decode-into branch December 30, 2024 20:03
@github-actions github-actions bot mentioned this pull request Dec 30, 2024
gatesn pushed a commit that referenced this pull request Dec 30, 2024
## 🤖 New release
* `fsst-rs`: 0.4.3 -> 0.4.4 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.4.4](v0.4.3...v0.4.4) -
2024-12-30

### Added

- add dbtext decompression benchmark (#44)

### Other

- Decode into an uninitialized byte slice
([#63](#63))
- *(deps)* lock file maintenance (#62)
- *(deps)* lock file maintenance (#60)
- *(deps)* lock file maintenance (#59)
- *(deps)* update mozilla-actions/sccache-action action to v0.0.7 (#58)
- *(deps)* lock file maintenance (#57)
- *(deps)* lock file maintenance (#56)
- *(deps)* lock file maintenance (#55)
- *(deps)* lock file maintenance (#54)
- *(deps)* lock file maintenance (#53)
- *(deps)* lock file maintenance (#50)
- *(deps)* lock file maintenance (#49)
- *(deps)* lock file maintenance (#47)
- *(deps)* lock file maintenance (#46)
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Add support to decode into vortex-buffer
2 participants