From b8e9e99cf096357d37c67d423ccb657652879ba1 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Fri, 24 Nov 2023 13:28:13 +0000 Subject: [PATCH] NFC: Remove "Backend" from MetaEntry template arg This parameter is in fact instantiated with FrontendSlabMetadata, so the use of Backend here is confusing. --- src/snmalloc/mem/metadata.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/snmalloc/mem/metadata.h b/src/snmalloc/mem/metadata.h index 8b1314e2e..e7937e9d8 100644 --- a/src/snmalloc/mem/metadata.h +++ b/src/snmalloc/mem/metadata.h @@ -589,19 +589,19 @@ namespace snmalloc * Entry stored in the pagemap. See docs/AddressSpace.md for the full * FrontendMetaEntry lifecycle. */ - template + template class FrontendMetaEntry : public MetaEntryBase { /** * Ensure that the template parameter is valid. */ static_assert( - std::is_convertible_v, + std::is_convertible_v, "The front end requires that the back end provides slab metadata that is " "compatible with the front-end's structure"); public: - using SlabMetadata = BackendSlabMetadata; + using SlabMetadata = SlabMetadataType; constexpr FrontendMetaEntry() = default; @@ -612,9 +612,8 @@ namespace snmalloc * `get_remote_and_sizeclass`. */ SNMALLOC_FAST_PATH - FrontendMetaEntry(BackendSlabMetadata* meta, uintptr_t remote_and_sizeclass) - : MetaEntryBase( - unsafe_to_uintptr(meta), remote_and_sizeclass) + FrontendMetaEntry(SlabMetadata* meta, uintptr_t remote_and_sizeclass) + : MetaEntryBase(unsafe_to_uintptr(meta), remote_and_sizeclass) { SNMALLOC_ASSERT_MSG( (REMOTE_BACKEND_MARKER & remote_and_sizeclass) == 0, @@ -645,12 +644,10 @@ namespace snmalloc * guarded by an assert that this chunk is being used as a slab (i.e., has * an associated owning allocator). */ - [[nodiscard]] SNMALLOC_FAST_PATH BackendSlabMetadata* - get_slab_metadata() const + [[nodiscard]] SNMALLOC_FAST_PATH SlabMetadata* get_slab_metadata() const { SNMALLOC_ASSERT(get_remote() != nullptr); - return unsafe_from_uintptr( - meta & ~META_BOUNDARY_BIT); + return unsafe_from_uintptr(meta & ~META_BOUNDARY_BIT); } };