Skip to content

Commit

Permalink
Docs: Index header has no capacity
Browse files Browse the repository at this point in the history
The lack of capacity data is intended.
Reserving memory is a non-persistent operation
by nature, and we shouldn't save that metadata
on the disk.

Closes #452

Co-authored-by: Christopher Yim <4638193+GoodKnight@users.noreply.github.com>
  • Loading branch information
ashvardanian and GoodKnight committed Aug 3, 2024
1 parent f80588d commit 8626482
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/usearch/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,14 @@ class memory_mapped_file_t {
}
};

/**
* @brief Metadata header for the serialized index.
*
* This structure is very minimalistic by design. It contains no information
* about the capacity of the index, so you'll have to `reserve` after loading.
* It also contains no info on the metric or key types, so you'll have to store
* that information elsewhere, like we do in `index_dense_head_t`.
*/
struct index_serialized_header_t {
std::uint64_t size = 0;
std::uint64_t connectivity = 0;
Expand Down

0 comments on commit 8626482

Please sign in to comment.