#include <UnrealMemory.h>
|
| uint32 | Alignment = DEFAULT_ALIGNMENT) |
| |
| SIZE_T | Count |
| |
| SIZE_T uint32 | Alignment = DEFAULT_ALIGNMENT) |
| |
| static UE_FORCEINLINE_HINT void * | Memmove (void *Dest, const void *Src, SIZE_T Count) |
| |
| static UE_FORCEINLINE_HINT int32 | Memcmp (const void *Buf1, const void *Buf2, SIZE_T Count) |
| |
| static UE_FORCEINLINE_HINT void * | Memset (void *Dest, uint8 Char, SIZE_T Count) |
| |
| template<class T > |
| static void | Memset (T &Src, uint8 ValueToSet) |
| |
| static UE_FORCEINLINE_HINT void * | Memzero (void *Dest, SIZE_T Count) |
| |
| static bool | MemIsZero (const void *Ptr, SIZE_T Count) |
| |
| template<class T > |
| static void | Memzero (T &Src) |
| |
| static UE_FORCEINLINE_HINT void * | Memcpy (void *Dest, const void *Src, SIZE_T Count) |
| |
| template<class T > |
| static void | Memcpy (T &Dest, const T &Src) |
| |
| static UE_FORCEINLINE_HINT void * | BigBlockMemcpy (void *Dest, const void *Src, SIZE_T Count) |
| |
| static UE_FORCEINLINE_HINT void * | StreamingMemcpy (void *Dest, const void *Src, SIZE_T Count) |
| |
| static UE_FORCEINLINE_HINT void * | ParallelMemcpy (void *Dest, const void *Src, SIZE_T Count, EMemcpyCachePolicy Policy=EMemcpyCachePolicy::StoreCached) |
| |
| static UE_FORCEINLINE_HINT void | Memswap (void *Ptr1, void *Ptr2, SIZE_T Size) |
| |
| static void | SystemFree (void *Ptr) |
| |
| static FORCENOINLINE CORE_API void | Free (void *Original) |
| |
| static FORCENOINLINE CORE_API SIZE_T | GetAllocSize (void *Original) |
| |
| static FORCENOINLINE CORE_API SIZE_T | QuantizeSize (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| static CORE_API void | Trim (bool bTrimThreadCaches=true) |
| |
| static CORE_API void | SetupTLSCachesOnCurrentThread () |
| |
| static CORE_API void | ClearAndDisableTLSCachesOnCurrentThread () |
| |
| static CORE_API void | MarkTLSCachesAsUsedOnCurrentThread () |
| |
| static CORE_API void | MarkTLSCachesAsUnusedOnCurrentThread () |
| |
| static CORE_API void | TestMemory () |
| |
| static CORE_API void | EnablePurgatoryTests () |
| |
| static CORE_API void | EnablePoisonTests () |
| |
| static CORE_API void | ExplicitInit (FMalloc &Allocator) |
| |
| static CORE_API void * | MallocExternal (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| static CORE_API void * | ReallocExternal (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| static CORE_API void | FreeExternal (void *Original) |
| |
| static CORE_API SIZE_T | GetAllocSizeExternal (void *Original) |
| |
| static CORE_API void * | MallocZeroedExternal (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| static CORE_API SIZE_T | QuantizeSizeExternal (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| | UE_ALLOCATION_FUNCTION (1) static inline void *SystemMalloc(SIZE_T Size) |
| |
| | UE_ALLOCATION_FUNCTION (1, 2) static FORCENOINLINE CORE_API void *Malloc(SIZE_T Count |
| |
| | UE_ALLOCATION_FUNCTION (2, 3) static FORCENOINLINE CORE_API void *Realloc(void *Original |
| |
| | UE_ALLOCATION_FUNCTION (1, 2) static FORCENOINLINE CORE_API void *MallocZeroed(SIZE_T Count |
| |
◆ AllocationHints
Some allocators can be given hints to treat allocations differently depending on how the memory is used, it's lifetime etc.
| Enumerator |
|---|
| None | |
| Default | |
| Temporary | |
| SmallPool | |
| Max | |
◆ BigBlockMemcpy()
◆ ClearAndDisableTLSCachesOnCurrentThread()
| void FMemory::ClearAndDisableTLSCachesOnCurrentThread |
( |
| ) |
|
|
static |
Clears the TLS caches on the current thread and disables any future caching.
◆ EnablePoisonTests()
| void FMemory::EnablePoisonTests |
( |
| ) |
|
|
static |
Called once main is started and we have -poisonmallocproxy.
◆ EnablePurgatoryTests()
| void FMemory::EnablePurgatoryTests |
( |
| ) |
|
|
static |
Called once main is started and we have -purgatorymallocproxy. This uses the purgatory malloc proxy to check if things are writing to stale pointers.
◆ ExplicitInit()
Set global allocator instead of creating it lazily on first allocation. Must only be called once and only if lazy init is disabled via a macro.
◆ Free()
◆ FreeExternal()
| void FMemory::FreeExternal |
( |
void * |
Original | ) |
|
|
static |
◆ GetAllocSize()
◆ GetAllocSizeExternal()
| SIZE_T FMemory::GetAllocSizeExternal |
( |
void * |
Original | ) |
|
|
static |
◆ MallocExternal()
◆ MallocZeroedExternal()
◆ MarkTLSCachesAsUnusedOnCurrentThread()
| void FMemory::MarkTLSCachesAsUnusedOnCurrentThread |
( |
| ) |
|
|
static |
Mark TLS caches for current thread as unused. Typically before going to sleep. These are the threads that we can trim without waking them up.
◆ MarkTLSCachesAsUsedOnCurrentThread()
| void FMemory::MarkTLSCachesAsUsedOnCurrentThread |
( |
| ) |
|
|
static |
Mark TLS caches for the current thread as used. Thread has woken up to do some processing and needs its TLS caches back.
◆ Memcmp()
◆ Memcpy() [1/2]
template<class T >
| static void FMemory::Memcpy |
( |
T & |
Dest, |
|
|
const T & |
Src |
|
) |
| |
|
inlinestatic |
◆ Memcpy() [2/2]
◆ MemIsZero()
Returns true if memory is zeroes, false otherwise.
◆ Memmove()
◆ Memset() [1/2]
◆ Memset() [2/2]
◆ Memswap()
◆ Memzero() [1/2]
◆ Memzero() [2/2]
◆ ParallelMemcpy()
◆ 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.
◆ QuantizeSizeExternal()
◆ ReallocExternal()
◆ SetupTLSCachesOnCurrentThread()
| void FMemory::SetupTLSCachesOnCurrentThread |
( |
| ) |
|
|
static |
Set up TLS caches on the current thread. These are the threads that we can trim.
◆ StreamingMemcpy()
◆ SystemFree()
◆ TestMemory()
| void FMemory::TestMemory |
( |
| ) |
|
|
static |
A helper function that will perform a series of random heap allocations to test the internal validity of the heap. Note, this function will "leak" memory, but another call will clean up previously allocated blocks before returning. This will help to A/B testing where you call it in a good state, do something to corrupt memory, then call this again and hopefully freeing some pointers will trigger a crash.
◆ Trim()
Releases as much memory as possible. Must be called from the main thread.
◆ UE_ALLOCATION_FUNCTION() [1/4]
| FMemory::UE_ALLOCATION_FUNCTION |
( |
1 |
| ) |
|
|
inline |
◆ UE_ALLOCATION_FUNCTION() [2/4]
| FMemory::UE_ALLOCATION_FUNCTION |
( |
1 |
, |
|
|
2 |
|
|
) |
| |
◆ UE_ALLOCATION_FUNCTION() [3/4]
| FMemory::UE_ALLOCATION_FUNCTION |
( |
1 |
, |
|
|
2 |
|
|
) |
| |
◆ UE_ALLOCATION_FUNCTION() [4/4]
| FMemory::UE_ALLOCATION_FUNCTION |
( |
2 |
, |
|
|
3 |
|
|
) |
| |
◆ Alignment [1/2]
◆ Alignment [2/2]
◆ Count
The documentation for this struct was generated from the following files: