pw_kvs: EntryCache class
- Allocate space for addresses in the derived KeyValueStore class. This
allows having multiple KeyValueStores with different redundancies,
without any wasted memory.
- Addresses are moved to a contiguous array instead of a Vector,
removing the kMaxEntries * uint32_t bytes of Vector overhead.
- Create the EntryCache and EntryMetadata abstractions. These bring
together KeyDescriptors and their addresses.
- Move functions for finding and updating KeyDescriptors to the
EntryCache and EntryMetadata classes.
- Start EntryCache unit tests. The tests will be expanded in future CLs.
Change-Id: I726ec198c0c4188086357ac6df944a7670c30000
diff --git a/pw_kvs/BUILD b/pw_kvs/BUILD
index e08c214..9700013 100644
--- a/pw_kvs/BUILD
+++ b/pw_kvs/BUILD
@@ -28,10 +28,12 @@
"alignment.cc",
"checksum.cc",
"entry.cc",
+ "entry_cache.cc",
"flash_memory.cc",
"format.cc",
"key_value_store.cc",
"public/pw_kvs/internal/entry.h",
+ "public/pw_kvs/internal/entry_cache.h",
"public/pw_kvs/internal/hash.h",
"public/pw_kvs/internal/key_descriptor.h",
"public/pw_kvs/internal/sector_descriptor.h",
@@ -118,6 +120,12 @@
)
pw_cc_test(
+ name = "entry_cache_test",
+ srcs = ["entry_cache_test.cc"],
+ deps = [":pw_kvs"],
+)
+
+pw_cc_test(
name = "key_value_store_test",
srcs = ["key_value_store_test.cc"],
deps = [