5#include "HAL/PlatformMemory.h"
6#include "HAL/MemoryBase.h"
8#if !defined(PLATFORM_BUILDS_MIMALLOC)
9# define PLATFORM_BUILDS_MIMALLOC 0
13# define PLATFORM_SUPPORTS_MIMALLOC 0
21
22
23class FMallocMimalloc final
29 virtual void* Malloc(SIZE_T Size, uint32 Alignment) override;
30 virtual void* TryMalloc(SIZE_T Size, uint32 Alignment) override;
31 virtual void* Realloc(
void* Ptr, SIZE_T NewSize, uint32 Alignment) override;
32 virtual void* TryRealloc(
void* Ptr, SIZE_T NewSize, uint32 Alignment) override;
33 virtual void Free(
void* Ptr) override;
34 virtual bool GetAllocationSize(
void *Original, SIZE_T &SizeOut) override;
35 virtual void Trim(
bool bTrimThreadCaches) override;
37 virtual bool IsInternallyThreadSafe()
const override
42 virtual const TCHAR* GetDescriptiveName( ) override
44 return TEXT(
"Mimalloc");
49 void OutOfMemory( uint64 Size, uint32 Alignment )
52 FPlatformMemory::OnOutOfMemory(Size, Alignment);
#define PLATFORM_SUPPORTS_MIMALLOC
#define PLATFORM_BUILDS_MIMALLOC
#define MIMALLOC_ALLOCATOR_ALLOWED