#include <MallocBinned2.h>
|
| | FMallocBinned2 () |
| |
| virtual | ~FMallocBinned2 () |
| |
| virtual bool | IsInternallyThreadSafe () const override |
| |
| virtual UE_AUTORTFM_NOAUTORTFM void * | Malloc (SIZE_T Size, uint32 Alignment) override |
| |
| virtual UE_AUTORTFM_NOAUTORTFM void * | Realloc (void *Ptr, SIZE_T NewSize, uint32 Alignment) override |
| |
| virtual UE_AUTORTFM_NOAUTORTFM void | Free (void *Ptr) override |
| |
| bool | GetSmallAllocationSize (void *Ptr, SIZE_T &SizeOut) const |
| |
| virtual bool | GetAllocationSize (void *Ptr, SIZE_T &SizeOut) override |
| |
| virtual FORCEINLINE SIZE_T | QuantizeSize (SIZE_T Count, uint32 Alignment) override |
| |
| virtual bool | ValidateHeap () override |
| |
| virtual void | Trim (bool bTrimThreadCaches) override |
| |
| virtual const TCHAR * | GetDescriptiveName () override |
| |
| virtual void | UpdateStats () override |
| |
| virtual void | OnMallocInitialized () override |
| |
| virtual void | OnPreFork () override |
| |
| virtual void | OnPostFork () override |
| |
| virtual uint64 | GetImmediatelyFreeableCachedMemorySize () const override |
| |
| virtual uint64 | GetTotalFreeCachedMemorySize () const override |
| |
| void * | MallocExternalSmall (SIZE_T Size, uint32 Alignment) |
| |
| void * | MallocExternalLarge (SIZE_T Size, uint32 Alignment) |
| |
| void | CanaryFail (const FFreeBlock *Block) const |
| |
| void | CanaryTest (const FFreeBlock *Block) const |
| |
| virtual void | DumpAllocatorStats (class FOutputDevice &Ar) override |
| |
| FORCEINLINE uint32 | PoolIndexToBinSize (uint32 PoolIndex) const |
| |
| void | FreeBundles (FBundleNode *Bundles, uint32 PoolIndex) |
| |
| void | FlushCurrentThreadCacheInternal (bool bNewEpochOnly=false) |
| |
| virtual void | GetAllocatorStats (FGenericMemoryStats &OutStats) override |
| |
| virtual CORE_API void * | TryMalloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void * | TryRealloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void * | MallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void * | TryMallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void | InitializeStatsMetadata () |
| |
| CORE_API void * | operator new (size_t Size) |
| |
| CORE_API void | operator delete (void *Ptr) |
| |
| void * | operator new[] (size_t Size) |
| |
| void | operator delete[] (void *Ptr) |
| |
| virtual CORE_API | ~FExec () |
| |
| virtual CORE_API bool | Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
|
| virtual void | SetupTLSCachesOnCurrentThread () override |
| |
| virtual void | ClearAndDisableTLSCachesOnCurrentThread () override |
| |
| virtual void | MarkTLSCachesAsUsedOnCurrentThread () override |
| |
| virtual void | MarkTLSCachesAsUnusedOnCurrentThread () override |
| |
| SIZE_T | QuantizeSizeCommon (SIZE_T Count, uint32 Alignment, const FMallocBinned2 &Alloc) const |
| |
| uint32 | BoundSizeToPoolIndex (SIZE_T Size, const uint8(&MemSizeToPoolIndex)[SIZE_TO_POOL_INDEX_NUM]) const |
| |
| FORCENOINLINE bool | PromoteToLargerBin (SIZE_T &Size, uint32 &Alignment, const FMallocBinned2 &Alloc) const |
| |
| bool | GetAllocationSizeExternal (void *Ptr, SIZE_T &SizeOut) |
| |
| int64 | GetTotalAllocatedSmallPoolMemory () const |
| |
| void | UpdateStatsCommon (const FMallocBinned2 &Alloc) |
| |
| void | AllocateHashBuckets () |
| |
| void | GetAllocatorStatsInternal (FGenericMemoryStats &OutStats, int64 TotalAllocatedSmallPoolMemory) |
| |
| void | UnrecognizedPointerFatalError (void *Ptr) |
| |
| void | LogLargeAllocation (SIZE_T Size) const |
| |
| virtual bool | Exec_Runtime (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
| virtual bool | Exec_Dev (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
| virtual bool | Exec_Editor (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
| static UE::FPlatformRecursiveMutex & | GetFreeBlockListsRegistrationMutex () |
| |
| static TArray< FPerThreadFreeBlockLists * > & | GetRegisteredFreeBlockLists () |
| |
| static void | OutOfMemory (uint64 Size, uint32 Alignment=0) |
| |
| FPtrToPoolMapping | PtrToPoolMapping |
| |
| uint64 | NumPoolsPerPage |
| |
| UE::FPlatformRecursiveMutex | ExternalAllocMutex |
| |
| std::atomic< uint64 > | MemoryTrimEpoch { 0 } |
| |
| static constexpr int | SIZE_TO_POOL_INDEX_NUM |
| |
| static uint32 | OsAllocationGranularity = 0 |
| |
| static CORE_API uint32 | BinnedTlsSlot = FPlatformTLS::InvalidTlsSlot |
| |
| static std::atomic< int64 > | TLSMemory |
| |
| static std::atomic< int64 > | ConsolidatedMemory |
| |
| static std::atomic< int64 > | AllocatedSmallPoolMemory |
| |
| static std::atomic< int64 > | AllocatedOSSmallPoolMemory |
| |
| static std::atomic< int64 > | AllocatedLargePoolMemory |
| |
| static std::atomic< int64 > | AllocatedLargePoolMemoryWAlignment |
| |
| static int64 | PoolInfoMemory |
| |
| static int64 | HashMemory |
| |
◆ FMallocBinned2()
| FMallocBinned2::FMallocBinned2 |
( |
| ) |
|
◆ ~FMallocBinned2()
| FMallocBinned2::~FMallocBinned2 |
( |
| ) |
|
|
virtual |
◆ AllocateMetaDataMemory()
| void * FMallocBinned2::AllocateMetaDataMemory |
( |
SIZE_T |
Size | ) |
|
|
static |
◆ CanaryFail()
| void FMallocBinned2::CanaryFail |
( |
const FFreeBlock * |
Block | ) |
const |
◆ CanaryTest()
| void FMallocBinned2::CanaryTest |
( |
const FFreeBlock * |
Block | ) |
const |
|
inline |
◆ DumpAllocatorStats()
Dumps current allocator stats to the log.
Reimplemented from FMalloc.
◆ FlushCurrentThreadCacheInternal()
| void FMallocBinned2::FlushCurrentThreadCacheInternal |
( |
bool |
bNewEpochOnly = false | ) |
|
◆ Free()
| void FMallocBinned2::Free |
( |
void * |
Original | ) |
|
|
overridevirtual |
◆ FreeBundles()
◆ FreeMetaDataMemory()
◆ GetAllocationSize()
If possible determine the size of the memory allocated at the given address
- Parameters
-
| Original | - Pointer to memory we are checking the size of |
| SizeOut | - If possible, this value is set to the size of the passed in pointer |
- Returns
- true if succeeded
Reimplemented from FMalloc.
◆ GetDescriptiveName()
| const TCHAR * FMallocBinned2::GetDescriptiveName |
( |
| ) |
|
|
overridevirtual |
Gets descriptive name for logging purposes.
- Returns
- pointer to human-readable malloc name
Reimplemented from FMalloc.
◆ GetImmediatelyFreeableCachedMemorySize()
| virtual uint64 FMallocBinned2::GetImmediatelyFreeableCachedMemorySize |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the amount of free memory cached by the allocator that can be returned to the system in case of a memory shortage
Reimplemented from FMalloc.
◆ GetSmallAllocationSize()
| bool FMallocBinned2::GetSmallAllocationSize |
( |
void * |
Ptr, |
|
|
SIZE_T & |
SizeOut |
|
) |
| const |
|
inline |
◆ GetTotalFreeCachedMemorySize()
| virtual uint64 FMallocBinned2::GetTotalFreeCachedMemorySize |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the amount of total free memory cached by the allocator. This includes memory that can be returned to the system in case of a memory shortage, see GetImmediatelyFreeableCachedMemorySize() as well as any memory that can't be returned back to the kernel, but can be used to satisfy some of the allocation requirements.
Reimplemented from FMalloc.
◆ IsInternallyThreadSafe()
| bool FMallocBinned2::IsInternallyThreadSafe |
( |
| ) |
const |
|
overridevirtual |
Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it.
Reimplemented from FMalloc.
◆ Malloc()
◆ MallocExternalLarge()
◆ MallocExternalSmall()
◆ OnMallocInitialized()
| void FMallocBinned2::OnMallocInitialized |
( |
| ) |
|
|
overridevirtual |
Notifies the malloc implementation that initialization of all allocators in GMalloc is complete, so it's safe to initialize any extra features that require "regular" allocations
Reimplemented from FMallocBinnedCommonBase.
◆ OnPostFork()
| void FMallocBinned2::OnPostFork |
( |
| ) |
|
|
overridevirtual |
Notifies the malloc implementation that the process has forked so we can try and avoid dirtying pre-fork pages.
Reimplemented from FMalloc.
◆ OnPreFork()
| void FMallocBinned2::OnPreFork |
( |
| ) |
|
|
overridevirtual |
Notifies the malloc implementation that the process is about to fork. May be used to trim caches etc.
Reimplemented from FMalloc.
◆ PoolIndexToBinSize()
◆ QuantizeSize()
For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. The return value will always be >= Count. This can be used to grow and shrink containers to optimal sizes. This call is always fast and threadsafe with no locking.
Reimplemented from FMalloc.
◆ Realloc()
◆ Trim()
| void FMallocBinned2::Trim |
( |
bool |
bTrimThreadCaches | ) |
|
|
overridevirtual |
Releases as much memory as possible. Must be called from the main thread.
Reimplemented from FMalloc.
◆ UpdateStats()
| void FMallocBinned2::UpdateStats |
( |
| ) |
|
|
overridevirtual |
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. MUST BE THREAD SAFE.
Reimplemented from FMalloc.
◆ ValidateHeap()
| bool FMallocBinned2::ValidateHeap |
( |
| ) |
|
|
overridevirtual |
Validates the allocator's heap
Reimplemented from FMalloc.
◆ MallocBinned2
◆ MemSizeToPoolIndex
| uint8 FMallocBinned2::MemSizeToPoolIndex = { 0 } |
|
static |
◆ SmallBinSizes
| uint16 FMallocBinned2::SmallBinSizes = { 0 } |
|
static |
◆ SmallPoolTables
The documentation for this class was generated from the following files: