diff --git a/src/mem/alloc.h b/src/mem/alloc.h index a81e6fa..b723eb7 100644 --- a/src/mem/alloc.h +++ b/src/mem/alloc.h @@ -1140,7 +1140,7 @@ namespace snmalloc sizeclass_t sizeclass) { check_client( - Metaslab::is_start_of_object(Slab::get_meta(slab), address_cast(p_ret)), + Slab::get_meta(slab)->is_start_of_object(address_cast(p_ret)), "Not deallocating start of an object"); small_dealloc_start(super, slab, p_auth, p_ret, sizeclass); diff --git a/src/mem/metaslab.h b/src/mem/metaslab.h index 7dc5fcd..ebe70da 100644 --- a/src/mem/metaslab.h +++ b/src/mem/metaslab.h @@ -152,12 +152,10 @@ namespace snmalloc return pointer_align_down(p.as_void()) == p; } - template - SNMALLOC_FAST_PATH static bool - is_start_of_object(CapPtr self, address_t p) + SNMALLOC_FAST_PATH bool is_start_of_object(address_t p) { return is_multiple_of_sizeclass( - self->sizeclass(), SLAB_SIZE - (p - address_align_down(p))); + sizeclass(), SLAB_SIZE - (p - address_align_down(p))); } /** @@ -187,7 +185,7 @@ namespace snmalloc self->set_full(meta); auto p = remove_cache_friendly_offset(n, self->sizeclass()); - SNMALLOC_ASSERT(is_start_of_object(self, address_cast(p))); + SNMALLOC_ASSERT(self->is_start_of_object(address_cast(p))); self->debug_slab_invariant(meta, entropy);