]> git.proxmox.com Git - mirror_edk2.git/blame - CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
Fix some typo and coding style issues in BaseCryptLib instances.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / SysCall / BaseMemAllocation.c
CommitLineData
97f98500
HT
1/** @file\r
2 Base Memory Allocation Routines Wrapper for Crypto library over OpenSSL\r
3 during PEI & DXE phases.\r
4\r
6b8ebcb8 5Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
97f98500
HT
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <OpenSslSupport.h>\r
17\r
18//\r
19// -- Memory-Allocation Routines --\r
20//\r
21\r
22/* Allocates memory blocks */\r
23void *malloc (size_t size)\r
24{\r
6b8ebcb8 25 return AllocatePool ((UINTN) size);\r
97f98500
HT
26}\r
27\r
28/* Reallocate memory blocks */\r
29void *realloc (void *ptr, size_t size)\r
30{\r
31 //\r
32 // BUG: hardcode OldSize == size! We have no any knowledge about\r
33 // memory size of original pointer ptr.\r
34 //\r
6b8ebcb8 35 return ReallocatePool ((UINTN) size, (UINTN) size, ptr);\r
97f98500
HT
36}\r
37\r
38/* De-allocates or frees a memory block */\r
39void free (void *ptr)\r
40{\r
41 FreePool (ptr);\r
42}\r