You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Memory Insights: Added analysis support for "free callstack" for an allocation (i.e. callstack when an allocation if freed). - Memory Insights: Switched CallstackId to 32 bit and moved the resolving of "id to pointer" outside of mem queries. This allows us to add the second callstack id and also ids for future metadata without increasing the size of FAllocationItem struct (from AllocationProvider). - Memory Insights: Refactored code re ThreadId and Tracker passed from AllocationAnalysis to AllocationProvider. - Memory Insights: Refactored code re CallstackProvider to map a CallstackId directly as an index into array of callstacks. #rb Johan.Berg #preflight 6201460a6773a3612898c4de [CL 18886419 by ionut matasaru in ue5-main branch]
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "AllocationsProvider.h"
|
|
#include "CallstacksProvider.h"
|
|
#include "Async/TaskGraphInterfaces.h"
|
|
#include "Containers/Queue.h"
|
|
#include "HAL/PlatformAtomics.h"
|
|
|
|
#include <atomic>
|
|
|
|
namespace TraceServices
|
|
{
|
|
|
|
class ILinearAllocator;
|
|
|
|
struct FAllocationsImpl
|
|
{
|
|
FAllocationsImpl* Next = nullptr;
|
|
TArray<const FAllocationItem*> Items;
|
|
};
|
|
|
|
class FAllocationsQuery
|
|
{
|
|
friend class FAllocationsQueryAsyncTask;
|
|
|
|
public:
|
|
FAllocationsQuery(const FAllocationsProvider& InAllocationsProvider, const FCallstacksProvider& InCallstacksProvider, const IAllocationsProvider::FQueryParams& InParams);
|
|
|
|
void Cancel();
|
|
IAllocationsProvider::FQueryStatus Poll();
|
|
|
|
private:
|
|
void Run();
|
|
void QueryLiveAllocs(TArray<const FAllocationItem*>& OutAllocs) const;
|
|
|
|
private:
|
|
const FAllocationsProvider& AllocationsProvider;
|
|
const FCallstacksProvider& CallstacksProvider;
|
|
|
|
IAllocationsProvider::FQueryParams Params;
|
|
|
|
TQueue<FAllocationsImpl*> Results;
|
|
|
|
std::atomic<bool> IsWorking;
|
|
std::atomic<bool> IsCanceling;
|
|
|
|
FGraphEventRef CompletedEvent;
|
|
};
|
|
|
|
} // namespace TraceServices
|