User/BaseMemoryLib: Fix aligned page alloc

This commit is contained in:
Marvin Häuser 2023-06-13 11:29:20 +02:00
parent fb43d90309
commit 2bcc3cbd7f

View File

@ -231,6 +231,10 @@ InternalAllocatePagesAlign (
// Check that we have not gone beyond the single allocation size limit
//
if (RequestedAllocationSize <= mPoolAllocationSizeLimit) {
if (Alignment < EFI_PAGE_SIZE) {
Alignment = EFI_PAGE_SIZE;
}
#ifdef _WIN32
Buffer = _aligned_malloc (RequestedAllocationSize, Alignment);
#else // !_WIN32