diff --git a/Source/Engine/Core/Config.h b/Source/Engine/Core/Config.h index feae02139..7a514be27 100644 --- a/Source/Engine/Core/Config.h +++ b/Source/Engine/Core/Config.h @@ -39,7 +39,7 @@ #define ENABLE_ASSERTION 1 // Enable/disable assertion for Engine low layers -#define ENABLE_ASSERTION_LOW_LAYERS ENABLE_ASSERTION && (BUILD_DEBUG) +#define ENABLE_ASSERTION_LOW_LAYERS ENABLE_ASSERTION && (BUILD_DEBUG || FLAX_TESTS) // Scripting API defines (see C++ scripting documentation for more info) #define API_ENUM(...) diff --git a/Source/Engine/Core/Memory/Allocation.h b/Source/Engine/Core/Memory/Allocation.h index a1e6daae2..14aa41f7a 100644 --- a/Source/Engine/Core/Memory/Allocation.h +++ b/Source/Engine/Core/Memory/Allocation.h @@ -12,16 +12,13 @@ template class FixedAllocation { public: - template class Data { private: - byte _data[Capacity * sizeof(T)]; public: - FORCE_INLINE Data() { } @@ -48,14 +45,14 @@ public: FORCE_INLINE void Allocate(uint64 capacity) { -#if BUILD_DEBUG +#if ENABLE_ASSERTION_LOW_LAYERS ASSERT(capacity <= Capacity); #endif } FORCE_INLINE void Relocate(uint64 capacity, int32 oldCount, int32 newCount) { -#if BUILD_DEBUG +#if ENABLE_ASSERTION_LOW_LAYERS ASSERT(capacity <= Capacity); #endif } @@ -80,16 +77,13 @@ public: class HeapAllocation { public: - template class Data { private: - T* _data = nullptr; public: - FORCE_INLINE Data() { } @@ -133,7 +127,7 @@ public: FORCE_INLINE void Allocate(uint64 capacity) { -#if BUILD_DEBUG +#if ENABLE_ASSERTION_LOW_LAYERS ASSERT(!_data); #endif _data = (T*)Allocator::Allocate(capacity * sizeof(T)); @@ -182,12 +176,10 @@ template class InlinedAllocation { public: - template class Data { private: - typedef typename OtherAllocator::template Data OtherData; bool _useOther = false; @@ -195,7 +187,6 @@ public: OtherData _other; public: - FORCE_INLINE Data() { }