Eliminate pointer_cast()

Since we anticipate address_t not carrying provenance on CHERI, but
rather being vaddr_t there, it doesn't make sense to offer conversion
back to a provenance-carrying pointer.

Thankfully, there is not much to be done here: the uses were few and
could be replaced with the vocabulary of other pointer operations in
ds/address.h
This commit is contained in:
Nathaniel Filardo
2020-05-15 19:32:09 +00:00
parent 79ad6630d3
commit 3f32f37e60
3 changed files with 37 additions and 29 deletions

View File

@@ -181,8 +181,8 @@ namespace snmalloc
Slab* alloc_slab(sizeclass_t sizeclass)
{
uint8_t h = head;
Slab* slab = pointer_cast<Slab>(
address_cast(this) + (static_cast<size_t>(h) << SLAB_BITS));
Slab* slab = pointer_offset(
reinterpret_cast<Slab*>(this), (static_cast<size_t>(h) << SLAB_BITS));
uint8_t n = meta[h].next;