Added persistence capabilities to AccountIndex by implementing save and load functionality for disk storage.
What changed?
add index field to both ref and ref-head structs
Added loadFromDisk and saveToDisk methods to AccountIndex
Modified AccountRef structure to handle serialization properly
Added helper function allocFilename to DiskMemoryAllocator
Added comprehensive tests for saving and loading account index state
How to test?
Run the new tests: "save and load account index state" and "save and load account index state -- multi linked list"
Tests verify that account references and their relationships are properly preserved when saving to disk and loading back
Why make this change?
To enable persistence of account index data between program runs, allowing the system to maintain state across restarts and reducing the need to rebuild indices from scratch. This improves system reliability and startup performance.
TL;DR
Added persistence capabilities to AccountIndex by implementing save and load functionality for disk storage.
What changed?
loadFromDisk
andsaveToDisk
methods to AccountIndexallocFilename
to DiskMemoryAllocatorHow to test?
Why make this change?
To enable persistence of account index data between program runs, allowing the system to maintain state across restarts and reducing the need to rebuild indices from scratch. This improves system reliability and startup performance.