diff --git a/src/mem/metaslab.h b/src/mem/metaslab.h index 9d774e2..ae2b7ea 100644 --- a/src/mem/metaslab.h +++ b/src/mem/metaslab.h @@ -180,8 +180,9 @@ namespace snmalloc MetaEntry(Metaslab* meta, RemoteAllocator* remote, sizeclass_t sizeclass) : meta(meta) { + /* remote might be nullptr; cast to uintptr_t before offsetting */ remote_and_sizeclass = - address_cast(pointer_offset(remote, sizeclass)); + pointer_offset(reinterpret_cast(remote), sizeclass); } [[nodiscard]] Metaslab* get_metaslab() const @@ -192,7 +193,7 @@ namespace snmalloc [[nodiscard]] RemoteAllocator* get_remote() const { return reinterpret_cast( - bits::align_down(remote_and_sizeclass, alignof(RemoteAllocator))); + pointer_align_down(remote_and_sizeclass)); } [[nodiscard]] sizeclass_t get_sizeclass() const