]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
2 Base Memory Allocation Routines Wrapper for Crypto library over OpenSSL
3 during PEI & DXE phases.
5 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <CrtLibSupport.h>
17 #include <Library/MemoryAllocationLib.h>
20 // -- Memory-Allocation Routines --
23 /* Allocates memory blocks */
24 void *malloc (size_t size
)
26 return AllocatePool ((UINTN
) size
);
29 /* Reallocate memory blocks */
30 void *realloc (void *ptr
, size_t size
)
33 // BUG: hardcode OldSize == size! We have no any knowledge about
34 // memory size of original pointer ptr.
36 return ReallocatePool ((UINTN
) size
, (UINTN
) size
, ptr
);
39 /* De-allocates or frees a memory block */
43 // In Standard C, free() handles a null pointer argument transparently. This
44 // is not true of FreePool() below, so protect it.