diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-11-22 00:52:31 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-11-22 00:52:31 +0000 |
commit | d777486198d8ec66e2f461a641d505f4063e1e5e (patch) | |
tree | 04b082cf0c5bbc1062f89d73f2bee6c4a5144f76 | |
parent | 7b3381a2322d179a8ea75ad6e0445b96eb3d087b (diff) | |
download | edk2-d777486198d8ec66e2f461a641d505f4063e1e5e.zip edk2-d777486198d8ec66e2f461a641d505f4063e1e5e.tar.gz edk2-d777486198d8ec66e2f461a641d505f4063e1e5e.tar.bz2 |
Update to use ReallocatePool() from BaseMemoryLib
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6677 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Library/GenericBdsLib/DevicePath.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c index f420625..421bba0 100644 --- a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c +++ b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c @@ -16,42 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "InternalBdsLib.h"
/**
-
- Adjusts the size of a previously allocated buffer.
-
- @param OldPool A pointer to the buffer whose size is being adjusted.
- @param OldSize The size of the current buffer.
- @param NewSize The size of the new buffer.
-
- @return The new buffer allocated. If allocatio failed, NULL will be returned.
-
-**/
-VOID *
-ReallocatePool (
- IN VOID *OldPool,
- IN UINTN OldSize,
- IN UINTN NewSize
- )
-{
- VOID *NewPool;
-
- NewPool = NULL;
- if (NewSize != 0) {
- NewPool = AllocateZeroPool (NewSize);
- }
-
- if (OldPool != NULL) {
- if (NewPool != NULL) {
- CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
- }
-
- FreePool (OldPool);
- }
-
- return NewPool;
-}
-
-/**
Concatenates a formatted unicode string to allocated pool.
The caller must free the resulting buffer.
@@ -95,9 +59,9 @@ CatPrint ( StringSize += (StrSize (Str->str) - sizeof (UINT16));
Str->str = ReallocatePool (
- Str->str,
StrSize (Str->str),
- StringSize
+ StringSize,
+ Str->str
);
ASSERT (Str->str != NULL);
}
@@ -1523,7 +1487,7 @@ DevicePathToStr ( Done:
NewSize = (Str.len + 1) * sizeof (CHAR16);
- Str.str = ReallocatePool (Str.str, NewSize, NewSize);
+ Str.str = ReallocatePool (NewSize, NewSize, Str.str);
ASSERT (Str.str != NULL);
Str.str[Str.len] = 0;
return Str.str;
|