-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: deduplicated heap-optimized vectors (#636)
* feat: added `heapopt` crate with `Vec` * refactor: use `heapopt::Vec` wherever possible
- Loading branch information
Showing
8 changed files
with
504 additions
and
132 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "heapopt" | ||
version = "0.1.0" | ||
repository.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
derive-where = "1" | ||
heapless = "0" | ||
|
||
[dev-dependencies] | ||
more-asserts = "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Data structures that allow optimization for rare heap usage. | ||
//! Optimization can be achieved by storing part of the data in a fixed size heapless part. | ||
//! If that capacity is not enough, the rest is stored in a heap allocated part. | ||
pub mod vec; | ||
|
||
/// Vec is a re-export of the [`vec::Vec`]`. | ||
pub type Vec<T, const N: usize> = vec::Vec<T, N>; | ||
|
||
/// VecIter is a re-export of the [`vec::Iter`]`. | ||
pub type VecIter<'a, T> = vec::Iter<'a, T>; | ||
|
||
/// VecIterMut is a re-export of the [`vec::IterMut`]`. | ||
pub type VecIterMut<'a, T> = vec::IterMut<'a, T>; |
Oops, something went wrong.