8#include "HAL/CriticalSection.h"
9#include "HAL/MallocBinnedCommon.h"
35 check(PageIndex < NumPages && (uint8*)Addr >= LowAddress);
41 check(PageIndex < NumPages);
49 check(bCommitted || NotPendingDecommit.IsAllocated(PageIndex));
57 check(!bPendingDecommit || CurrentlyCommitted.IsAllocated(PageIndex));
58 return bPendingDecommit;
74 check(IsCommitted(Addr));
80 check(IsCommitted(Addr));
86 FPageCache(
void *InLowAdress,
void* InHighAddress, size_t InPageSize)
100 check(PageSize && LowAddress && HighAddress > LowAddress);
108 check(NumPages && MemSize);
109 FScopeLock Lock(&CriticalSection);
117 check(Size > 0 && IsAligned(Size, PageSize));
119 uint32 EndPage = StartPage + Size /
PageSize;
123 FScopeLock Lock(&CriticalSection);
125 for (uint32 Index = StartPage; Index < EndPage; Index++)
138 size_t
Commit(
void *InAddr, size_t Size, size_t& OutUnPending, T&& CommitFunction)
191 size_t
ForceDecommit(
void *InAddr, size_t Size, size_t& OutUnPending, T&& DecommitFunction)
363 FScopeLock Lock(&CriticalSection);
368 FScopeLock Lock(&CriticalSection);
FWindowsCriticalSection FCriticalSection
uint32 PendingDecommittedPages
uint32 AddrToPageIndex(void *Addr) const
FPageCache(void *InLowAdress, void *InHighAddress, size_t InPageSize)
void InitPageCache(void *Memory)
void MarkPendingDecommit(void *Addr)
bool IsCommitted(void *Addr) const
size_t GetFreeableMemory()
size_t Commit(void *InAddr, size_t Size, size_t &OutUnPending, T &&CommitFunction)
void * PageIndexToAddr(uint32 PageIndex) const
bool IsPendingDecommit(void *Addr) const
void UnMarkPendingDecommit(void *Addr)
uint32 GetMemoryRequirements()
size_t TryDecommitPending(size_t Size, T &&DecommitFunction)
FBitTree CurrentlyCommitted
FCriticalSection CriticalSection
size_t MarkForPendingDecommit(void *InAddr, size_t Size)
void Decommit(void *Addr)
size_t ForceDecommit(void *InAddr, size_t Size, size_t &OutUnPending, T &&DecommitFunction)
size_t DecommitPending(size_t Size, T &&DecommitFunction)
FBitTree NotPendingDecommit