UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MallocLibpas.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreTypes.h"
6#include "HAL/MemoryBase.h"
7
8#if !defined(PLATFORM_BUILDS_LIBPAS)
9# define PLATFORM_BUILDS_LIBPAS 0
10#endif
11
12#define LIBPASMALLOC_ENABLED PLATFORM_BUILDS_LIBPAS
13
14#if LIBPASMALLOC_ENABLED
15
19class FMallocLibpas final
20 : public FMalloc
21{
22public:
24 virtual void* Malloc(SIZE_T Size, uint32 Alignment) override;
25 virtual void* TryMalloc(SIZE_T Size, uint32 Alignment) override;
26 virtual void* Realloc(void* Ptr, SIZE_T NewSize, uint32 Alignment) override;
27 virtual void* TryRealloc(void* Ptr, SIZE_T NewSize, uint32 Alignment) override;
28 virtual void Free(void* Ptr) override;
29 virtual bool GetAllocationSize(void *Original, SIZE_T &SizeOut) override;
30 virtual void Trim(bool bTrimThreadCaches) override;
31
32 virtual bool IsInternallyThreadSafe() const override
33 {
34 return true;
35 }
36
37 virtual const TCHAR* GetDescriptiveName( ) override
38 {
39 return TEXT("Libpas");
40 }
41
42 virtual void OnPreFork() override;
43 virtual void OnPostFork() override;
44};
45
46#endif // LIBPASMALLOC_ENABLED
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32 Size
Definition VulkanMemory.cpp:4034
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition MemoryBase.h:99
virtual const TCHAR * GetDescriptiveName()
Definition MemoryBase.h:248
virtual void OnPreFork()
Definition MemoryBase.h:261
virtual bool GetAllocationSize(void *Original, SIZE_T &SizeOut)
Definition MemoryBase.h:158
virtual CORE_API void * TryMalloc(SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition MemoryBase.cpp:95
virtual void * Malloc(SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)=0
virtual bool IsInternallyThreadSafe() const
Definition MemoryBase.h:230
virtual CORE_API void * TryRealloc(void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition MemoryBase.cpp:100
virtual void Trim(bool bTrimThreadCaches)
Definition MemoryBase.h:166
virtual void * Realloc(void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)=0
virtual void OnPostFork()
Definition MemoryBase.h:266