Holzhaus / vinylla

https://holzhaus.github.io/vinylla/
Mozilla Public License 2.0
10 stars 3 forks source link

Support no-std #3

Open uklotzde opened 3 years ago

uklotzde commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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