]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
Clarify that FreePages(), FreeAlignedPages(), and FreePool() may perform n actions...
[mirror_edk2.git] / MdePkg / Library / PeiMemoryAllocationLib / MemoryAllocationLib.c
index f9e723ef2f1ac3cb44cf960f9bb9cbc46d5a32ee..4e5f8fadd492be1943766624ccb8f638c563da71 100644 (file)
@@ -128,7 +128,8 @@ AllocateReservedPages (
 \r
   Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer\r
   must have been allocated on a previous call to the page allocation services of the Memory\r
-  Allocation Library.\r
+  Allocation Library.  If it is not possible to free allocated pages, then this function will\r
+  peform no actions.\r
   \r
   If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
@@ -145,6 +146,7 @@ FreePages (
   IN UINTN  Pages\r
   )\r
 {\r
+  ASSERT (Pages != 0);\r
   //\r
   // PEI phase does not support to free pages, so leave it as NOP.\r
   //\r
@@ -288,7 +290,8 @@ AllocateAlignedReservedPages (
 \r
   Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer\r
   must have been allocated on a previous call to the aligned page allocation services of the Memory\r
-  Allocation Library.\r
+  Allocation Library.  If it is not possible to free allocated pages, then this function will \r
+  peform no actions.\r
   \r
   If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r
   Library, then ASSERT().\r
@@ -305,6 +308,7 @@ FreeAlignedPages (
   IN UINTN  Pages\r
   )\r
 {\r
+  ASSERT (Pages != 0);\r
   //\r
   // PEI phase does not support to free pages, so leave it as NOP.\r
   //\r
@@ -775,7 +779,8 @@ ReallocateReservedPool (
   Memory Allocation Library.\r
 \r
   Frees the buffer specified by Buffer.  Buffer must have been allocated on a previous call to the\r
-  pool allocation services of the Memory Allocation Library.\r
+  pool allocation services of the Memory Allocation Library.  If it is not possible to free pool\r
+  resources, then this function will peform no actions.\r
   \r
   If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,\r
   then ASSERT().\r