From 34c7be79580d936c9d19505cf30651c838732e0a Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 16 Feb 2024 10:28:14 +0000 Subject: [PATCH] [*] update --- Include/auROXTL/auHashUtils.hpp | 3 +++ Include/auROXTL/auMemoryModel.hpp | 35 +++++++++++++------------ Include/auROXTL/auString.hpp | 13 ++------- Include/auROXTL/auTryConstructUtils.hpp | 2 +- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/Include/auROXTL/auHashUtils.hpp b/Include/auROXTL/auHashUtils.hpp index aec2390..f99ce8f 100644 --- a/Include/auROXTL/auHashUtils.hpp +++ b/Include/auROXTL/auHashUtils.hpp @@ -87,6 +87,9 @@ namespace AuHash return hash; } #else + // nvm lost respect for google + // maybe the above hashing algorithms could squeeze out a few more cycles on some architectures, but i doubt it. + inline _AH_HAS_RETARD_CONSTEXPR AuUInt32 ComputeUnseededHash(AuUInt32 key) { #if defined(_AU_HASH_RETARD_COMPILER) diff --git a/Include/auROXTL/auMemoryModel.hpp b/Include/auROXTL/auMemoryModel.hpp index 552af59..aef1b82 100644 --- a/Include/auROXTL/auMemoryModel.hpp +++ b/Include/auROXTL/auMemoryModel.hpp @@ -55,26 +55,14 @@ struct AuEnableSharedFromThis : Aurora::Memory::ExSharedFromThis - static inline AU_NORETURN void SysPanic(T... args); -#elif !defined(AURORA_RUNTIME_MEMORY_PANIC) - namespace Aurora::Debug - { - void Panic(); - } -#endif +static inline AU_NORETURN void SysPanic(const char *pMsg); static auline void AuMemoryPanic(const char *msg) { #if defined(AURORA_RUNTIME_MEMORY_PANIC) AURORA_RUNTIME_MEMORY_PANIC(msg); #else - #if defined(_AUHAS_FMT) - SysPanic(msg); - #else - Aurora::Debug::Panic(); - #endif + SysPanic(msg); #endif } @@ -239,9 +227,6 @@ constexpr AuUInt AuSizeOf(const AuSPtr) return sizeof(T); } -template -static auline void AU_NORETURN SysPanic(T... args); - template static void auline AuSafeDelete(T *in) { @@ -324,4 +309,20 @@ namespace Aurora::Memory using StringAllocator = BaseAuroraRuntimeAllocator; #endif +} + +namespace AuHash +{ + template + struct hash> + { + _AH_HAS_RETARD_CONSTEXPR AuUInt operator ()(const AuSPtr &ptr) const + { + #if defined(AURORA_IS_32BIT) + return ComputeUnseededHash(AuUInt(ptr.get())); + #else + return ComputeLongHash(AuUInt(ptr.get())); + #endif + } + }; } \ No newline at end of file diff --git a/Include/auROXTL/auString.hpp b/Include/auROXTL/auString.hpp index b2de5e2..15b4a61 100644 --- a/Include/auROXTL/auString.hpp +++ b/Include/auROXTL/auString.hpp @@ -13,16 +13,7 @@ #if defined(AURORA_ROXTL_CONTAINERS_USE_PURE) using AuString = std::string; #elif defined(AURORA_ROXTL_STRING_USE_STR_ALLOCATOR) - template , Aurora::Memory::StringAllocator>> - struct _AuStdExString : Base_t - { - using Base_t::Base_t; - - _AuStdExString(const std::string &str) : Base_t(str.begin(), str.end()) - {} - }; - - using AuString = _AuStdExString<>; + using AuString = std::basic_string, Aurora::Memory::StringAllocator>; #else using AuString = std::string; -#endif \ No newline at end of file +#endif diff --git a/Include/auROXTL/auTryConstructUtils.hpp b/Include/auROXTL/auTryConstructUtils.hpp index a63f689..e9029ee 100644 --- a/Include/auROXTL/auTryConstructUtils.hpp +++ b/Include/auROXTL/auTryConstructUtils.hpp @@ -116,7 +116,7 @@ template AuTryConstructWithDefaultPair(T &&def, Args&& ... args) { CtorCode_t code; - T object = AuTryConstructWithDefault(AuReference(code), AuFoward(def), AuForward(args)...); + T object = AuTryConstructWithDefault(AuReference(code), AuForward(def), AuForward(args)...); return AuMakePair(AuMove(code), AuMove(object)); }