NFC: pointer_offset* functions always return void*

This requires that the caller perform the cast on the output rather than the
input, which is a little closer to the truth.  Shuffle some casts into the right
position.
This commit is contained in:
Nathaniel Filardo
2021-03-02 20:45:51 +00:00
committed by Matthew Parkinson
parent f295a3f191
commit cbab7a3455
5 changed files with 14 additions and 15 deletions

View File

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