pagemap: assert that entry types match
More directly ensure that a "basic" pagemap's type matches its "concrete" pagemap parameter's entry type. Absent this check, getting this wrong won't be detected until even further along in template code generation (when considering a method that sees the mismatch).
This commit is contained in:
committed by
Nathaniel Filardo
parent
2936467736
commit
30da31d245
@@ -28,6 +28,10 @@ namespace snmalloc
|
||||
*/
|
||||
using Entry = PagemapEntry;
|
||||
|
||||
static_assert(
|
||||
std::is_same_v<PagemapEntry, typename ConcreteMap::EntryType>,
|
||||
"BasicPagemap's PagemapEntry and ConcreteMap disagree!");
|
||||
|
||||
/**
|
||||
* Instance of the concrete pagemap, accessible to the backend so that
|
||||
* it can call the init method whose type dependent on fixed_range.
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace snmalloc
|
||||
size_t size{0};
|
||||
|
||||
public:
|
||||
using EntryType = T;
|
||||
|
||||
/**
|
||||
* Ensure this range of pagemap is accessible
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user