FMemory::QuantizeSize

For some allocators this will return the actual size that should be requested to eliminate internal fragmentation.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/HAL/UnrealMemory.h

Include

#include "HAL/UnrealMemory.h"

Source

/Engine/Source/Runtime/Core/Public/HAL/FMemory.inl

Syntax

static SIZE_T QuantizeSize
(
    SIZE_T Count,
    uint32 Alignment
)

Remarks

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.