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

Support no-std #3

Open
uklotzde opened this issue Feb 18, 2021 · 2 comments
Open

Support no-std #3

uklotzde opened this issue Feb 18, 2021 · 2 comments

Comments

@uklotzde
Copy link
Contributor

uklotzde commented Feb 18, 2021

It should be possible to use this library in a no-std (bare metal) environment.

The only heap allocation that is needed is for the lookup table. The size is known in advance and the required memory could be allocated statically.

By switching to hashbrown::HashMap this should be possible.

Since Rust 1.36, this is now the HashMap implementation for the Rust standard library. However you may still want to use this crate instead since it works in environments without std, such as embedded systems and kernels.

@Holzhaus
Copy link
Owner

The size is known in advance and the required memory could be allocated statically.

It's only known if the LFSR is using a maximum length characteristic polynomial. But I guess this is the case for all LFSR-based time codes and in the worst case we allocate too much. So I'll look into it.

@uklotzde
Copy link
Contributor Author

This is not urgent. The issue was only intended as a reminder for later when we have a first working version.

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

No branches or pull requests

2 participants