+/** @brief Storage for snapshot memory pages
+ *
+ * The first (lower) layer of the per-page snapshot mechanism is a page
+ * store: it's responsibility is to store immutable shareable
+ * reference-counted memory pages independently of the snapshoting
+ * logic. Snapshot management and representation, soft-dirty tracking is
+ * handled to an higher layer. READMORE
+ *
+ * Data structure:
+ *
+ * * A pointer (`memory_`) to a (currently anonymous) `mmap()`ed memory
+ * region holding the memory pages (the address of the first page).
+ *
+ * We want to keep this memory region aligned on the memory pages (so
+ * that we might be able to create non-linear memory mappings on those
+ * pages in the future) and be able to expand it without coyping the
+ * data (there will be a lot of pages here): we will be able to
+ * efficiently expand the memory mapping using `mremap()`, moving it
+ * to another virtual address if necessary.
+ *
+ * Because we will move this memory mapping on the virtual address
+ * space, only the index of the page will be stored in the snapshots
+ * and the page will always be looked up by going through `memory`:
+ *
+ * void* page = (char*) page_store->memory + page_index << pagebits;
+ *
+ * * The number of pages mapped in virtual memory (`capacity_`). Once all
+ * those pages are used, we need to expand the page store with
+ * `mremap()`.
+ *
+ * * A reference count for each memory page `page_counts_`. Each time a
+ * snapshot references a page, the counter is incremented. If a
+ * snapshot is freed, the reference count is decremented. When the
+ * reference count, of a page reaches 0 it is added to a list of available
+ * pages (`free_pages_`).
+ *
+ * * A list of free pages `free_pages_` which can be reused. This avoids having
+ * to scan the reference count list to find a free page.
+ *
+ * * When we are expanding the memory map we do not want to add thousand of page
+ * to the `free_pages_` list and remove them just afterwards. The `top_index_`
+ * field is an index after which all pages are free and are not in the `free_pages_`
+ * list.
+ *
+ * * When we are adding a page, we need to check if a page with the same
+ * content is already in the page store in order to reuse it. For this
+ * reason, we maintain an index (`hash_index_`) mapping the hash of a
+ * page to the list of page indices with this hash.
+ * We use a fast (non cryptographic) hash so there may be conflicts:
+ * we must be able to store multiple indices for the same hash.