摘要 |
A non-volatile flash store memory system for storing persistent data with low overhead. The flash store comprises an active flash memory sector and one or more non-active backup sectors. Each memory sector includes a header to indicate the status of the sector and multiple data records, each with their own headers. The data records are organized by key identifiers in combination with offset values to create a linked-list file structure. New records in the active sector can be sequentially added, while existing records can be marked as deleted if it is desired to remove them. Extra memory space can be recaptured by performing a compacting sequence, in which the active records are copied from the active sector to a backup sector, while skipping those records that are marked as deleted. Upon successful completion of the copying process the backup sector becomes the new active sector, and the former active sector is marked as inactive. The compacting sequence is performed so that there is always a valid copy of each data record at all times, and no data will be lost in the event of a power failure or other similar anomaly.
|