]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Base Memory Allocation Routines Wrapper for Crypto library over OpenSSL\r | |
3 | during PEI & DXE phases.\r | |
4 | \r | |
5 | Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT 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 | |
23 | void *malloc (size_t size)\r | |
24 | {\r | |
25 | return AllocatePool ((UINTN)size);\r | |
26 | }\r | |
27 | \r | |
28 | /* Reallocate memory blocks */\r | |
29 | void *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 | |
35 | return ReallocatePool ((UINTN)size, (UINTN)size, ptr);\r | |
36 | }\r | |
37 | \r | |
38 | /* De-allocates or frees a memory block */\r | |
39 | void free (void *ptr)\r | |
40 | {\r | |
41 | FreePool (ptr);\r | |
42 | }\r |