From dfd7279e84e9d541c380364e0d18b8aeb078fdde Mon Sep 17 00:00:00 2001 From: Patedam Date: Sat, 14 Feb 2026 18:12:19 -0500 Subject: [PATCH] Fix build error in release --- Juliet/include/Core/Container/Vector.h | 13 ++++++++----- Juliet/include/Engine/Debug/MemoryDebugger.h | 5 ++++- JulietApp/main.cpp | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Juliet/include/Core/Container/Vector.h b/Juliet/include/Core/Container/Vector.h index fc85ba5..aa4867e 100644 --- a/Juliet/include/Core/Container/Vector.h +++ b/Juliet/include/Core/Container/Vector.h @@ -55,12 +55,15 @@ namespace Juliet { Data = ArenaPushArray(Arena, newCapacity); } - else if (AllowRealloc && !InternalArena) + else if constexpr (AllowRealloc) { - DataFirst = Data = - static_cast(ArenaReallocate(Arena, Data, Capacity * sizeof(Type), newCapacity * sizeof(Type), - AlignOf(Type), true JULIET_DEBUG_ONLY(, "VectorRealloc"))); - DataLast = Data + Count - 1; + if (!InternalArena) + { + DataFirst = Data = + static_cast(ArenaReallocate(Arena, Data, Capacity * sizeof(Type), newCapacity * sizeof(Type), + AlignOf(Type), true JULIET_DEBUG_ONLY(, "VectorRealloc"))); + DataLast = Data + Count - 1; + } } Capacity = newCapacity; } diff --git a/Juliet/include/Engine/Debug/MemoryDebugger.h b/Juliet/include/Engine/Debug/MemoryDebugger.h index 90c74d1..b586d37 100644 --- a/Juliet/include/Engine/Debug/MemoryDebugger.h +++ b/Juliet/include/Engine/Debug/MemoryDebugger.h @@ -1,9 +1,12 @@ #pragma once -#include #include +#if JULIET_DEBUG + namespace Juliet::Debug { JULIET_API void DebugDrawMemoryArena(); } // namespace Juliet::Debug + +#endif diff --git a/JulietApp/main.cpp b/JulietApp/main.cpp index daf9ab4..68c0df3 100644 --- a/JulietApp/main.cpp +++ b/JulietApp/main.cpp @@ -352,7 +352,9 @@ void JulietApplication::Update() if (ShowMemoryDebugger) { +#if JULIET_DEBUG Debug::DebugDrawMemoryArena(); +#endif } }