ds/address: add pointer diff function
And use it rather than open-coding subtraction of two address_cast-s.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user