ds/address: add pointer diff function

And use it rather than open-coding subtraction of two address_cast-s.
This commit is contained in:
Nathaniel Filardo
2019-05-12 20:01:54 +01:00
parent eb2d8890de
commit 83c467eb92
5 changed files with 19 additions and 8 deletions

View File

@@ -1193,7 +1193,7 @@ namespace snmalloc
#ifdef CHECK_CLIENT
if (!is_multiple_of_sizeclass(
sizeclass_to_size(sizeclass),
address_cast(slab) + SUPERSLAB_SIZE - address_cast(p)))
pointer_diff(p, pointer_offset(slab, SUPERSLAB_SIZE))))
{
error("Not deallocating start of an object");
}