[*] Config sewage

This commit is contained in:
Reece Wilson 2022-03-26 16:31:56 +00:00
parent 947356120b
commit 526444882b
4 changed files with 38 additions and 15 deletions

View File

@ -15,7 +15,16 @@
#define AUROXTL_COMMODITY_CATCH while (0)
#endif
#if (!defined(AURORA_ENGINE_KERNEL) && \
!defined(_AUHAS_AURORARUNTIME))
#define AURORA_ROXTL_ALLOCATORS_USE_STD
#endif
#if defined(AURORA_ROXTL_ALLOCATORS_USE_STD)
#define AURORA_ROXTL_CONTAINERS_USE_PURE
#endif
// Crossing API boundaries will resort in an alloc + copy
// Don't enable unless you're in the ecosystem
// Default behaviour (omitted): use the exact std::string type
//#define AURORA_ROXTL_STRING_USE_STR_ALLOCATOR

View File

@ -13,21 +13,19 @@
#include "auMemoryModel.hpp"
#if defined(_CPPSHARP) || defined(_AURORA_NO_SPECIAL_ARRAY_OPTIMIAZATION) || (!defined(_AUHAS_AURORARUNTIME) && !defined(AURORA_ENGINE_KERNEL))
#if defined(AURORA_ROXTL_CONTAINERS_USE_PURE)
template <class T>
using AuList = AURORA_RUNTIME_AU_LIST<T>;
template <class T>
using AuList = AURORA_RUNTIME_AU_LIST<T>;
#else
template <class T>
using AuList = AURORA_RUNTIME_AU_LIST<T,
AuConditional_t<AuIsClass_v<T>,
Aurora::Memory::ClassArrayAllocator<T>,
Aurora::Memory::PrimitiveArrayAllocator<T>
>
>;
template <class T>
using AuList = AURORA_RUNTIME_AU_LIST<T,
AuConditional_t<AuIsClass_v<T>,
Aurora::Memory::ClassArrayAllocator<T>,
Aurora::Memory::PrimitiveArrayAllocator<T>
>
>;
#endif

View File

@ -156,6 +156,18 @@ static void auline AuSafeDelete(T *in)
namespace Aurora::Memory
{
#if defined(AURORA_ROXTL_ALLOCATORS_USE_STD)
template<typename T>
using PrimitiveArrayAllocator = std::allocator<T>;
template<typename T>
using ClassArrayAllocator = std::allocator<T>;
template<typename T>
using StringAllocator = std::allocator<T>;
#else
static void *__FAlloc(Types::size_t length, Types::size_t align);
static void __Free(void *buffer);
@ -195,6 +207,7 @@ namespace Aurora::Memory
}
};
template<typename T>
using PrimitiveArrayAllocator = BaseAuroraRuntimeAllocator<T>;
@ -204,4 +217,5 @@ namespace Aurora::Memory
template<typename T>
using StringAllocator = BaseAuroraRuntimeAllocator<T>;
#endif
}

View File

@ -10,7 +10,9 @@
//#include "tinyutf8.h"
//#define AU_STRING_IS_TINYUTF_EXPERIMENT
#if defined(AURORA_ROXTL_STRING_USE_STR_ALLOCATOR)
#if defined(AURORA_ROXTL_CONTAINERS_USE_PURE)
using AuString = std::string;
#elif defined(AURORA_ROXTL_STRING_USE_STR_ALLOCATOR)
template <class Base_t = std::basic_string<char, std::char_traits<char>, Aurora::Memory::StringAllocator<char>>>
struct _AuStdExString : Base_t
{