From 9e527bbe3c1203fa1e7949f2456ea42f8e8a7900 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sun, 21 Apr 2024 06:04:37 +0100 Subject: [PATCH] [*] pmr equality? --- Include/auROXTL/auMemoryModel.hpp | 38 ++++++++++++++----------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/Include/auROXTL/auMemoryModel.hpp b/Include/auROXTL/auMemoryModel.hpp index 11aba30..7dc8435 100644 --- a/Include/auROXTL/auMemoryModel.hpp +++ b/Include/auROXTL/auMemoryModel.hpp @@ -313,28 +313,22 @@ namespace Aurora::Memory template void construct(U *p, Args&&... args) { - if constexpr (AuIsClass_v) - { - new ((void *)p) U(AuForward(args)...); - } + new ((void *)p) U(AuForward(args)...); } template void construct_at(U *p, Args&&... args) { - if constexpr (AuIsClass_v) - { - new ((void *)p) U(AuForward(args)...); - } + new ((void *)p) U(AuForward(args)...); } - constexpr void deallocate(const T *pType, + void deallocate(const T *pType, const size_t count) { this->deallocate_bytes((void *)pType, 0, 0); } - constexpr AU_ALLOC T *allocate(const size_t count) + AU_ALLOC T *allocate(const size_t count) { if (!count) { @@ -360,18 +354,14 @@ namespace Aurora::Memory U *new_object(CtorArgs&&... args) { U *p = this->allocate_object(); - if constexpr (AuIsClass_v && - !AuIsTriviallyConstructible_v) + try { - try - { - this->construct(p, AuForward(args)...); - } - catch (...) - { - this->deallocate_object(p); - throw; - } + this->construct(p, AuForward(args)...); + } + catch (...) + { + this->deallocate_object(p); + throw; } return p; } @@ -392,6 +382,12 @@ namespace Aurora::Memory { return true; } + + template + inline bool operator==(const BaseAuroraRuntimeAllocator &op) + { + return true; + } };