I'm trying to implement Dynamical size collection to EEPROM, which should support deletion from middle of it if/when needed, but write cycles should be kept in mind.
what i have thinked of is to reserve X amount of space from static location to have index what to load on system boot, and keep track of next free "slot" in the collection and such, but this doesn't support deletion of multiple items too well, would be easy to manage thought.
or i could reserve byte or two per entry in the collection and mark it as deleted, then always read it all to find out where to write next entry, maybe even always write new entry as last item of the collection until i have no choice than to overwrite allready deleted items .(i guess this help with the wearing of EEPROM since i don't have to write to same location so often)
How would you do it?
- Data size is constant per collection, was it uint8_t or typedef struct foo, the collection should only contain one type of entrys (i don't think re-ordering is the thing one wants to do when saving stuff in eeprom)
- Efficient in terms of endurance of the eeprom and memory footprint.