From 62cce1a20e650a908395891eca6b371353c2f85b Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Thu, 17 Mar 2022 17:53:15 +0000 Subject: [PATCH] backend/largebuddyrange: remove unnecessary casts Since Holder is just an alias for uintptr_t and the fields in the MetaEntry are uintptr_t-s, just return the lvalue-s directly rather than jumping through *reinterpret_cast(& ...). --- src/backend/largebuddyrange.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/largebuddyrange.h b/src/backend/largebuddyrange.h index 1d15dfe..5f18248 100644 --- a/src/backend/largebuddyrange.h +++ b/src/backend/largebuddyrange.h @@ -43,9 +43,9 @@ namespace snmalloc MetaEntry& entry = Pagemap::template get_metaentry_mut(address_cast(k)); if (direction) - return *reinterpret_cast(&entry.meta); + return entry.meta; - return *reinterpret_cast(&entry.remote_and_sizeclass); + return entry.remote_and_sizeclass; } static bool is_red(Contents k)