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
|
#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
|
#else
|
||||||
return _aligned_malloc (Size, Alignment);
|
return _aligned_malloc (Size, Alignment);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue