PagemapRegisterRange: don't presume Pagemap entry type

To date, we've had exactly one kind of Pagemap and it held exactly one
type of thing, a descendant of class MetaEntryBase.

PagemapRegisterRange tacitly assumed that the Pagemap (adapter) it
interacted would therefore store entries that could have .set_boundary()
called on them.  But in general there's no requirement that this be
true; Pagemaps are generic data structures.

To enable reuse of the PagemapRegisterRange machinery more generally,
change the type of Pagemap::register_range() to take a pointer (rather
than an address) and move the MetaEntryBase-specific functionality to
the backend_helpers/pagemap adapter.
This commit is contained in:
Nathaniel Wesley Filardo
2022-11-28 04:45:17 +00:00
committed by Nathaniel Filardo
parent 06873ac366
commit 7f3b59eaf9
6 changed files with 37 additions and 23 deletions

View File

@@ -36,7 +36,7 @@ namespace snmalloc
using LocalState = StandardLocalState<
Pal,
Pagemap,
Pipe<PalRange<Pal>, PagemapRegisterRange<Pagemap, false>>>;
Pipe<PalRange<Pal>, PagemapRegisterRange<Pagemap>>>;
using GlobalPoolState = PoolState<CoreAllocator<CustomConfig>>;