AddressSpace: use Backend to access Pagemap

And do so by type, rather than by value.  While here, introduce a C++20 concept
for this Backend-offered proxy and adjust the template parameters appropriately.

This will be useful for the process sandbox code, which needs to mediate stores
to the pagemap, but can provide a read-only view.
This commit is contained in:
Nathaniel Wesley Filardo
2021-08-20 21:19:18 +01:00
committed by Nathaniel Wesley Filardo
parent 7eb8769950
commit 70c3e00df7
8 changed files with 168 additions and 93 deletions

View File

@@ -95,7 +95,7 @@ namespace snmalloc
{
auto [first, last] = list[i].extract_segment(key);
MetaEntry entry =
SharedStateHandle::get_meta_data(address_cast(first));
SharedStateHandle::Pagemap::get_meta_data(address_cast(first));
entry.get_remote()->enqueue(first, last, key);
sent_something = true;
}
@@ -117,7 +117,8 @@ namespace snmalloc
// Use the next N bits to spread out remote deallocs in our own
// slot.
auto r = resend.take(key);
MetaEntry entry = SharedStateHandle::get_meta_data(address_cast(r));
MetaEntry entry =
SharedStateHandle::Pagemap::get_meta_data(address_cast(r));
auto i = entry.get_remote()->trunc_id();
size_t slot = get_slot<allocator_size>(i, post_round);
list[slot].add(r, key);