Support routines for memory allocation routines based \r
on boot services for Dxe phase drivers.\r
\r
- Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials \r
+ Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
http://opensource.org/licenses/bsd-license.php \r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param PoolType The type of pool to allocate.\r
@param OldSize The size, in bytes, of OldBuffer.\r
{\r
VOID *NewBuffer;\r
\r
- //\r
- // Check the boundary for OldBuffer even if the allocation failure.\r
- //\r
- ASSERT (OldBuffer == NULL || MIN (OldSize, NewSize) <= MAX_ADDRESS - (UINTN) OldBuffer + 1);\r
NewBuffer = InternalAllocateZeroPool (PoolType, NewSize);\r
if (NewBuffer != NULL && OldBuffer != NULL) {\r
CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize));\r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param OldSize The size, in bytes, of OldBuffer.\r
@param NewSize The size, in bytes, of the buffer to reallocate.\r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param OldSize The size, in bytes, of OldBuffer.\r
@param NewSize The size, in bytes, of the buffer to reallocate.\r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param OldSize The size, in bytes, of OldBuffer.\r
@param NewSize The size, in bytes, of the buffer to reallocate.\r