CloverBootloader/Xcode/cpp_tests/Include/Library/MemoryAllocationLib.c
jief666 16c627596f Rename OSVersion to macOSVersion.
Fixed some icons ordering in main menu.
Fixed macOs version detection for custom entries.
Fixed main Big Sur partition appearing in menu.
Refactor IsValidGuidAsciiString.
2021-01-31 12:50:23 +03:00

35 lines
697 B
C

//
// MemoryAllocationLib.c
// cpp_tests UTF16 signed char
//
// Created by Jief on 30/01/2021.
// Copyright © 2021 JF Knudsen. All rights reserved.
//
#include "MemoryAllocationLib.h"
void* AllocatePool(UINTN AllocationSize)
{
return (void*)malloc((size_t)AllocationSize);
}
void* AllocateZeroPool(UINTN AllocationSize)
{
void* p = (void*)malloc((size_t)AllocationSize);
memset(p, 0, (size_t)AllocationSize);
return p;
}
void* ReallocatePool(UINTN OldSize, UINTN NewSize, void* OldBuffer)
{
(void)OldSize;
if ( !OldBuffer ) return AllocatePool(NewSize);
return (void*)realloc(OldBuffer, (size_t)NewSize);
}
void FreePool(IN VOID *Buffer)
{
free((void*)Buffer);
}