After moving to 5.6.1, we started getting assertions where we had code validating that memory returned from FMemory::Malloc() returned the proper alignment, in our case 16 byte alignment for SIMD.
The specific issue we had was happening during a commandlet that was generating NavMesh for Havok. There was an allocation that was 61456 bytes with 16 byte alignment. It was getting 8 byte alignment (Win64 default alignment) back from Mimalloc in the commandlet (Editor). This was happening on Windows Server 2025, and there’s a good chance it just doesn’t happen on Wine/Linux.
I did some digging and found that Mimalloc had a change to it about a year ago that just shipped with 5.6 in its aligned allocation codepath. I reverted that change and this assert went away entirely. I dug into it more and found that more modern versions of Mimalloc handle this exact case when asking the OS for aligned memory and will fallback to an overallocation and manual alignment in that case.
Change that introduced this issue: https://github.com/EpicGames/UnrealEngine/commit/21a903b6f6c90f8f804715976e1991e3b8c99237
Snippet where newer versions of Mimalloc handle the wrong alignment returned: https://github.com/EpicGames/UnrealEngine/blob/6978b63c8951e57d97048d8424a0bebd637dde1d/Engine/Source/ThirdParty/mimalloc/2\.1\.2/src/os.c\#L237\-L281
Are there plans to move to a newer version of Mimalloc anytime soon? There are lots of features and bug fixes like this particular issue that I’d love to see in Unreal.