BaseTools/CommonLib: Replace aligned_alloc with posix_memalign

This commit is contained in:
Marvin Häuser 2023-06-13 13:34:59 +02:00 committed by Mikhail Krichanov
parent 028bb3e2c7
commit 03de312094
1 changed files with 9 additions and 1 deletions

View File

@ -502,7 +502,15 @@ InternalAlignedAlloc (
)
{
#ifndef _WIN32
return aligned_alloc (Alignment, Size);
int Result;
void *Buffer;
Result = posix_memalign (&Buffer, Alignment, Size);
if (Result != 0) {
return NULL;
}
return Buffer;
#else
return _aligned_malloc (Size, Alignment);
#endif