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:
committed by
Nathaniel Wesley Filardo
parent
7eb8769950
commit
70c3e00df7
@@ -377,7 +377,7 @@ namespace snmalloc
|
||||
{
|
||||
auto p = message_queue().peek();
|
||||
auto& entry =
|
||||
SharedStateHandle::get_meta_data(snmalloc::address_cast(p));
|
||||
SharedStateHandle::Pagemap::get_meta_data(snmalloc::address_cast(p));
|
||||
|
||||
auto r = message_queue().dequeue(key_global);
|
||||
|
||||
@@ -538,7 +538,8 @@ namespace snmalloc
|
||||
|
||||
SNMALLOC_FAST_PATH void dealloc_local_object(void* p)
|
||||
{
|
||||
auto entry = SharedStateHandle::get_meta_data(snmalloc::address_cast(p));
|
||||
auto entry =
|
||||
SharedStateHandle::Pagemap::get_meta_data(snmalloc::address_cast(p));
|
||||
if (likely(dealloc_local_object_fast(entry, p, entropy)))
|
||||
return;
|
||||
|
||||
@@ -664,8 +665,8 @@ namespace snmalloc
|
||||
{
|
||||
bool need_post = true; // Always going to post, so ignore.
|
||||
auto n = p->atomic_read_next(key_global);
|
||||
auto& entry =
|
||||
SharedStateHandle::get_meta_data(snmalloc::address_cast(p));
|
||||
auto& entry = SharedStateHandle::Pagemap::get_meta_data(
|
||||
snmalloc::address_cast(p));
|
||||
handle_dealloc_remote(entry, p, need_post);
|
||||
p = n;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user