removing-memory-arena #2

Merged
Patedam merged 2 commits from removing-memory-arena into main 2026-02-14 21:26:11 -05:00
3 changed files with 14 additions and 6 deletions
Showing only changes of commit dfd7279e84 - Show all commits

View File

@@ -55,13 +55,16 @@ namespace Juliet
{ {
Data = ArenaPushArray<Type>(Arena, newCapacity); Data = ArenaPushArray<Type>(Arena, newCapacity);
} }
else if (AllowRealloc && !InternalArena) else if constexpr (AllowRealloc)
{
if (!InternalArena)
{ {
DataFirst = Data = DataFirst = Data =
static_cast<Type*>(ArenaReallocate(Arena, Data, Capacity * sizeof(Type), newCapacity * sizeof(Type), static_cast<Type*>(ArenaReallocate(Arena, Data, Capacity * sizeof(Type), newCapacity * sizeof(Type),
AlignOf(Type), true JULIET_DEBUG_ONLY(, "VectorRealloc"))); AlignOf(Type), true JULIET_DEBUG_ONLY(, "VectorRealloc")));
DataLast = Data + Count - 1; DataLast = Data + Count - 1;
} }
}
Capacity = newCapacity; Capacity = newCapacity;
} }
} }

View File

@@ -1,9 +1,12 @@
#pragma once #pragma once
#include <Core/Memory/MemoryArena.h>
#include <Juliet.h> #include <Juliet.h>
#if JULIET_DEBUG
namespace Juliet::Debug namespace Juliet::Debug
{ {
JULIET_API void DebugDrawMemoryArena(); JULIET_API void DebugDrawMemoryArena();
} // namespace Juliet::Debug } // namespace Juliet::Debug
#endif

View File

@@ -352,7 +352,9 @@ void JulietApplication::Update()
if (ShowMemoryDebugger) if (ShowMemoryDebugger)
{ {
#if JULIET_DEBUG
Debug::DebugDrawMemoryArena(); Debug::DebugDrawMemoryArena();
#endif
} }
} }