From e72a16a6454b519e3d2584da14a12fe00de965af Mon Sep 17 00:00:00 2001 From: GoogleBen Date: Tue, 4 Feb 2025 09:44:16 -0600 Subject: [PATCH] Add two missing functions --- include/RED4ext/CNamePool-inl.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/RED4ext/CNamePool-inl.hpp b/include/RED4ext/CNamePool-inl.hpp index f42d8e811..eb4aa7a48 100644 --- a/include/RED4ext/CNamePool-inl.hpp +++ b/include/RED4ext/CNamePool-inl.hpp @@ -80,6 +80,19 @@ RED4EXT_INLINE const RED4ext::CNamePoolAllocator::CNamePoolNodeAllocWrapper* RED return GetWrapper(inner.next); } +RED4EXT_INLINE const RED4ext::CNamePoolAllocator::CNamePoolNodeAllocWrapper& RED4ext::CNamePoolAllocator:: + CNamePoolNodeAllocWrapper::GetWrapper(const CNamePoolNode& aNode) +{ + return *GetWrapper(&aNode); +} + +RED4EXT_INLINE const RED4ext::CNamePoolAllocator::CNamePoolNodeAllocWrapper* RED4ext::CNamePoolAllocator:: + CNamePoolNodeAllocWrapper::GetWrapper(const CNamePoolNode* aNode) +{ + return std::bit_cast(std::bit_cast(aNode) - + offsetof(CNamePoolNodeAllocWrapper, inner)); +} + RED4EXT_INLINE RED4ext::CNamePoolAllocator::Iterator& RED4ext::CNamePoolAllocator::Iterator::operator++() { m_node = m_node->NextInList();