tweedegolf / sequential-storage

A crate for storing data in flash memory with minimal need for erasing pages
Apache License 2.0
87 stars 8 forks source link

Add caching #19

Closed diondokter closed 5 months ago

diondokter commented 6 months ago

Fixes #5

diondokter commented 6 months ago

Need to add dirty checks. Not sure what the best way is. The idea is that any changes mark the cache as dirty.

At the end of all operations when we know the flash state is consistent, we unmark the cache dirty. Then when a cache is dirty at the start of an operation we invalidate it so we make sure we don't hold on to any incorrect cache data.