6#include "HAL/MemoryBase.h"
12
13
14
19 #include "Windows/WindowsHWrapper.h"
23
24
25
26
27
28class FMallocStomp final :
public FMalloc
33 static constexpr SIZE_T SentinelExpectedValue = 0xdeadbeefdeadbeef;
36 static constexpr SIZE_T SentinelExpectedValue = 0xdeadbeef;
39 const SIZE_T PageSize;
41 struct FAllocationData
44 void *FullAllocationPointer;
54 const bool bUseUnderrunMode;
56 UPTRINT VirtualAddressCursor = 0;
57 SIZE_T VirtualAddressMax = 0;
58 static constexpr SIZE_T VirtualAddressBlockSize = 1 * 1024 * 1024 * 1024;
62 FMallocStomp(
const bool InUseUnderrunMode =
false);
65
66
67
68
69
70
71
72
73
74
75 virtual void* Malloc(SIZE_T Size, uint32 Alignment) override;
77 virtual void* TryMalloc(SIZE_T Size, uint32 Alignment) override;
80
81
82
83
84
85
86
87
88 virtual void* Realloc(
void* InPtr, SIZE_T NewSize, uint32 Alignment) override;
90 virtual void* TryRealloc(
void* InPtr, SIZE_T NewSize, uint32 Alignment) override;
93
94
95
96
97 virtual void Free(
void* InPtr) override;
100
101
102
103
104
105
106
107
108 virtual bool GetAllocationSize(
void *Original, SIZE_T &SizeOut) override;
111
112
113
114
115 virtual void DumpAllocatorStats( FOutputDevice& Ar ) override
121
122
123 virtual bool ValidateHeap() override
130 virtual bool Exec( UWorld* InWorld,
const TCHAR* Cmd, FOutputDevice& Ar ) override
135 virtual const TCHAR* GetDescriptiveName() override
137 return TEXT(
"Stomp" );
140 virtual bool IsInternallyThreadSafe()
const override