Expose mutable reference to pagemap

This commit is contained in:
Matthew Parkinson
2022-02-03 17:22:21 +00:00
committed by Matthew Parkinson
parent 79486b6331
commit 69c824d54d
2 changed files with 30 additions and 4 deletions

View File

@@ -272,6 +272,20 @@ namespace snmalloc
return concretePagemap.template get<potentially_out_of_range>(p);
}
/**
* Get the metadata associated with a chunk.
*
* Set template parameter to true if it not an error
* to access a location that is not backed by a chunk.
*/
template<bool potentially_out_of_range = false>
SNMALLOC_FAST_PATH static MetaEntry&
get_metaentry_mut(LocalState* ls, address_t p)
{
UNUSED(ls);
return concretePagemap.template get_mut<potentially_out_of_range>(p);
}
/**
* Set the metadata associated with a chunk.
*/