Improve check_bounds init check.
This commit is contained in:
committed by
Matthew Parkinson
parent
419347ba4a
commit
ef64f6c31b
@@ -335,6 +335,12 @@ namespace snmalloc
|
||||
UNUSED(local_state);
|
||||
return concretePagemap.get_bounds();
|
||||
}
|
||||
|
||||
static bool is_initialised(LocalState* ls)
|
||||
{
|
||||
UNUSED(ls);
|
||||
return concretePagemap.is_initialised();
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
@@ -278,6 +278,14 @@ namespace snmalloc
|
||||
return body[p >> SHIFT];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the pagemap has been initialised.
|
||||
*/
|
||||
[[nodiscard]] bool is_initialised() const
|
||||
{
|
||||
return body_opt != nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the starting address corresponding to a given entry within the
|
||||
* Pagemap. Also checks that the reference actually points to a valid entry.
|
||||
|
||||
Reference in New Issue
Block a user