Optimize job system memory allocations

This commit is contained in:
Wojtek Figat
2024-06-24 23:19:01 +02:00
parent 3bbaa8dad0
commit b545d8800c
5 changed files with 145 additions and 95 deletions

View File

@@ -5,6 +5,7 @@
#include "Engine/Platform/Platform.h"
#include "Engine/Core/Memory/Memory.h"
#include "Engine/Core/Memory/Allocation.h"
#include "Engine/Core/Math/Math.h"
/// <summary>
/// Template for ring buffer with variable capacity.
@@ -98,4 +99,10 @@ public:
Memory::DestructItems(Get() + Math::Min(_front, _back), _count);
_front = _back = _count = 0;
}
void Release()
{
Clear();
_allocation.Free();
}
};