mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-04 13:23:26 +01:00
16c627596f
Fixed some icons ordering in main menu. Fixed macOs version detection for custom entries. Fixed main Big Sur partition appearing in menu. Refactor IsValidGuidAsciiString.
35 lines
697 B
C
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);
|
|
}
|