summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c')
-rw-r--r--MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
index f9e723ef2f..4e5f8fadd4 100644
--- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
@@ -128,7 +128,8 @@ AllocateReservedPages (
Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
must have been allocated on a previous call to the page allocation services of the Memory
- Allocation Library.
+ Allocation Library. If it is not possible to free allocated pages, then this function will
+ peform no actions.
If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
then ASSERT().
@@ -145,6 +146,7 @@ FreePages (
IN UINTN Pages
)
{
+ ASSERT (Pages != 0);
//
// PEI phase does not support to free pages, so leave it as NOP.
//
@@ -288,7 +290,8 @@ AllocateAlignedReservedPages (
Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
must have been allocated on a previous call to the aligned page allocation services of the Memory
- Allocation Library.
+ Allocation Library. If it is not possible to free allocated pages, then this function will
+ peform no actions.
If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
Library, then ASSERT().
@@ -305,6 +308,7 @@ FreeAlignedPages (
IN UINTN Pages
)
{
+ ASSERT (Pages != 0);
//
// PEI phase does not support to free pages, so leave it as NOP.
//
@@ -775,7 +779,8 @@ ReallocateReservedPool (
Memory Allocation Library.
Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- pool allocation services of the Memory Allocation Library.
+ pool allocation services of the Memory Allocation Library. If it is not possible to free pool
+ resources, then this function will peform no actions.
If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
then ASSERT().