mirror of https://github.com/acidanthera/audk.git
BaseTools/CommonLib: Replace aligned_alloc with posix_memalign
This commit is contained in:
parent
028bb3e2c7
commit
03de312094
|
@ -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…
Reference in New Issue