mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
BaseTools/CommonLib: Replace aligned_alloc with posix_memalign
This commit is contained in:
parent
1fef202932
commit
8171958c4e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user